Pony.fm/public/scripts/app/controllers/account-albums-edit.coffee

17 lines
480 B
CoffeeScript
Raw Normal View History

2013-07-28 09:09:10 +02:00
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
]