(function() { "use strict"; angular .module('shared') .component('menuEditFolderDescription', { templateUrl: '/shared/js/angular/file-cabinet/menu-edit-folder-description.html', controller: 'MenuEditFolderDescriptionCtrl', bindings: { folder: '<', popover: '<' } }) .controller('MenuEditFolderDescriptionCtrl', ['folderService', function MenuEditFolderDescriptionCtrl(folderService) { var ctrl = this; ctrl.$onInit = function() { }; ctrl.setEditMode = function() { folderService.setFolderDescriptionMode("edit"); if (ctrl.popover && ctrl.popover.popover) { ctrl.popover.popover.close(); } }; ctrl.addOrEditDescriptionString = function() { return ctrl.folder.description ? "edit" : "add"; }; }]); }());