54b3d257f716f7b2e6872ec5174330b164ffa2c5
[dlux.git] / modules / yangman-resources / src / main / resources / yangman / controllers / form / leaf-list.controller.js
1 define([], function () {
2     'use strict';
3
4     angular.module('app.yangman').controller('LeafListCtrl', LeafListCtrl);
5
6     LeafListCtrl.$inject = ['$scope'];
7
8     function LeafListCtrl($scope){
9         var yangLeafList = this;
10
11         // methods
12         yangLeafList.addListElem = addListElem;
13         yangLeafList.changed = changed;
14         yangLeafList.isActionMenu = isActionMenu;
15         yangLeafList.removeListElem = removeListElem;
16         yangLeafList.toggleExpanded = toggleExpanded;
17
18
19         // TODO :: do method description
20         function addListElem() {
21             $scope.node.addListElem();
22         }
23
24         // TODO :: do method description
25         function removeListElem(elem){
26             $scope.node.removeListElem(elem);
27         }
28
29         // TODO :: do method description
30         function changed() {
31             //$scope.preview();
32             $scope.buildRootRequest();
33         }
34
35         // TODO :: do method description
36         function toggleExpanded() {
37             $scope.node.expanded = !$scope.node.expanded;
38         }
39
40
41         /**
42          * Show hide action menu
43          * @returns {boolean|*}
44          */
45         function isActionMenu() {
46             return true;
47         }
48     }
49 });
50