Yangman - requests settings
[dlux.git] / modules / yangman-resources / src / main / resources / yangman / controllers / save-req-dialog.controller.js
index 0230a73a644e9a16edbe11aeb5e57bcb10e140ca..584d92ba7a9113c0c659c7cd921141dcb770a20e 100644 (file)
@@ -19,20 +19,34 @@ define([], function () {
 
         cloneRequests();
 
+        /**
+         * Get collection names matching the text that was already written
+         * @returns {*}
+         */
         function getColAutocomplete() {
             return vm.collectionNames ? $filter('filter')(vm.collectionNames, vm.collectionName) : vm.collectionNames;
         }
 
+        /**
+         * Clone requests to not affect source objects
+         */
         function cloneRequests(){
             vm.requests = vm.requests.map(function (req){
                 return req.clone();
             });
         }
 
+
+        /**
+         * Only cancel mdDialog
+         */
         function cancel() {
             $mdDialog.cancel();
         }
 
+        /**
+         * Try to save requests and return them in answer after hiding mdDialog
+         */
         function save() {
             vm.requests.forEach(function (reqObj){
                 reqObj.collection = vm.collectionName;