2016-04-17 17:53:26 +02:00
|
|
|
(function() {
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
angular
|
|
|
|
.module('harbor.details')
|
|
|
|
.directive('switchPaneProjects', switchPaneProjects);
|
|
|
|
|
2016-04-27 12:29:55 +02:00
|
|
|
SwitchPaneProjectsController.$inject = ['$scope'];
|
2016-04-19 19:20:07 +02:00
|
|
|
|
2016-04-27 12:29:55 +02:00
|
|
|
function SwitchPaneProjectsController($scope) {
|
2016-04-17 17:53:26 +02:00
|
|
|
var vm = this;
|
2016-04-20 08:12:53 +02:00
|
|
|
|
|
|
|
$scope.$on('isOpen', function(e, val){
|
|
|
|
vm.isOpen = val;
|
2016-04-19 19:20:07 +02:00
|
|
|
});
|
2016-04-27 12:29:55 +02:00
|
|
|
|
2016-05-01 19:46:50 +02:00
|
|
|
$scope.$watch('vm.selectedProject', function(current, origin) {
|
|
|
|
if(current){
|
|
|
|
vm.projectName = current.Name;
|
|
|
|
vm.selectedProject = current;
|
|
|
|
}
|
|
|
|
});
|
2016-04-27 12:29:55 +02:00
|
|
|
|
2016-04-17 17:53:26 +02:00
|
|
|
vm.switchPane = switchPane;
|
|
|
|
|
|
|
|
function switchPane() {
|
2016-04-19 19:20:07 +02:00
|
|
|
if(vm.isOpen) {
|
|
|
|
vm.isOpen = false;
|
2016-04-17 17:53:26 +02:00
|
|
|
}else{
|
2016-04-19 19:20:07 +02:00
|
|
|
vm.isOpen = true;
|
2016-04-17 17:53:26 +02:00
|
|
|
}
|
|
|
|
}
|
2016-04-28 19:36:39 +02:00
|
|
|
|
2016-04-17 17:53:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
function switchPaneProjects() {
|
|
|
|
var directive = {
|
|
|
|
restrict: 'E',
|
|
|
|
templateUrl: '/static/ng/resources/js/components/details/switch-pane-projects.directive.html',
|
|
|
|
replace: true,
|
|
|
|
scope: {
|
2016-04-19 19:20:07 +02:00
|
|
|
'selectedProject': '=',
|
|
|
|
'isOpen': '='
|
2016-04-17 17:53:26 +02:00
|
|
|
},
|
2016-04-28 19:36:39 +02:00
|
|
|
link: link,
|
2016-04-17 17:53:26 +02:00
|
|
|
controller: SwitchPaneProjectsController,
|
|
|
|
controllerAs: 'vm',
|
|
|
|
bindToController: true
|
|
|
|
}
|
|
|
|
|
|
|
|
return directive;
|
2016-04-28 19:36:39 +02:00
|
|
|
|
|
|
|
function link(scope, element, attrs, ctrl) {
|
2016-05-01 19:46:50 +02:00
|
|
|
|
2016-04-28 19:36:39 +02:00
|
|
|
}
|
2016-04-17 17:53:26 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
})();
|