harbor/static/resources/js/layout/details/details.controller.js

62 lines
1.4 KiB
JavaScript
Raw Normal View History

2016-04-19 19:20:07 +02:00
(function() {
'use strict';
angular
.module('harbor.details')
.controller('DetailsController', DetailsController);
2016-07-02 12:20:31 +02:00
DetailsController.$inject = ['$scope', '$timeout'];
2016-06-25 21:12:17 +02:00
2016-07-02 12:20:31 +02:00
function DetailsController($scope, $timeout) {
2016-04-19 19:20:07 +02:00
var vm = this;
2016-06-25 21:12:17 +02:00
2016-05-04 12:42:05 +02:00
vm.publicity = false;
vm.isProjectMember = false;
2016-05-04 12:42:05 +02:00
vm.togglePublicity = togglePublicity;
vm.sectionDefaultHeight = {'min-height': '579px'};
2016-07-02 12:20:31 +02:00
//Message dialog handler for details.
$scope.$on('modalTitle', function(e, val) {
vm.modalTitle = val;
});
$scope.$on('modalMessage', function(e, val) {
vm.modalMessage = val;
});
$scope.$on('raiseError', function(e, val) {
if(val) {
vm.action = function() {
$scope.$broadcast('showDialog', false);
};
vm.contentType = 'text/plain';
vm.confirmOnly = true;
$timeout(function() {
$scope.$broadcast('showDialog', true);
}, 350);
}
});
$scope.$on('raiseInfo', function(e, val) {
if(val) {
vm.action = function() {
val.action();
$scope.$broadcast('showDialog', false);
}
vm.contentType = val.contentType;
vm.confirmOnly = val.confirmOnly;
$scope.$broadcast('showDialog', true);
}
});
function togglePublicity(e) {
2016-05-04 12:42:05 +02:00
vm.publicity = e.publicity;
}
2016-04-19 19:20:07 +02:00
}
})();