Pony.fm/public/scripts/app/controllers/account-albums-edit.coffee
2013-07-28 02:09:10 -05:00

17 lines
No EOL
480 B
CoffeeScript

angular.module('ponyfm').controller "account-albums-edit", [
'$scope', '$state', 'taxonomies', '$dialog', 'lightbox'
($scope, $state, taxonomies, $dialog, lightbox) ->
$scope.isNew = $state.params.album_id == null
$scope.data.isEditorOpen = true
$scope.errors = {}
$scope.isDirty = false
$scope.touchModel = -> $scope.isDirty = true
if $scope.isNew
$scope.album =
title: ''
description: ''
$scope.$on '$destroy', -> $scope.data.isEditorOpen = false
]