Yangman - cleaned code
[dlux.git] / modules / yangman-resources / src / main / resources / yangman / controllers / requests-list.controller.js
index ded26755576472de256e01b80231639177d9a83e..62a35f891961f1126a63fff73e1352e5382911ff 100644 (file)
@@ -72,9 +72,6 @@ define([
         vm.deselectAllRequests = deselectAllRequests;
         vm.filterCollReq = filterCollReq;
 
-
-
-
         /**
          * Save request obje to collection from other controller
          * @param reqObj
@@ -177,6 +174,11 @@ define([
             else {
                 clearFileInputValue();
             }
+            removeButtonBackground();
+
+            function removeButtonBackground() {
+                $('#importCollection').next().css({ 'background': 'transparent' });
+            }
         }
 
         function toggleCollectionsSort() {
@@ -541,7 +543,10 @@ define([
                 }
             });
 
-            $scope.$on('YANGMAN_REFRESH_COLLECTIONS', loadCollectionsList);
+            $scope.$on('YANGMAN_REFRESH_COLLECTIONS', function (event, params){
+                loadCollectionsList();
+                (params.cbk || angular.noop)();
+            });
 
             // list type dependend operations
             if (mainList === 'history') {
@@ -560,14 +565,14 @@ define([
                 // saving from request header
                 $scope.$on('YANGMAN_SAVE_REQUEST_TO_COLLECTION', saveRequestFromExt);
                 // saving collections expanded status on refresh
-                $scope.$on('YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS', function(event, params){
-                    $scope.rootBroadcast('YANGMAN_REFRESH_COLLECTIONS');
-                    (params.cbk || angular.noop)();
+                $scope.$on('YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS', function(){
+                    var expandedColNames = vm.collectionList.getExpandedCollectionNames();
+                    $scope.rootBroadcast('YANGMAN_REFRESH_COLLECTIONS', {}, function (){
+                        vm.collectionList.expandCollectionByNames(expandedColNames);
+                    });
                 });
             }
 
-
-
         }
 
 
@@ -626,10 +631,7 @@ define([
          * Refresh and expand collections
          */
         function refreshCollectionsWithExpansion(){
-            var expandedCollNames = vm.collectionList.getExpandedCollectionNames();
-            $scope.rootBroadcast('YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS', null, function (){
-                vm.collectionList.expandCollectionByNames(expandedCollNames);
-            });
+            $scope.rootBroadcast('YANGMAN_REFRESH_AND_EXPAND_COLLECTIONS');
         }
 
     }