Scheduler comm
[unfold.git] / plugins / scheduler2 / static / js / scheduler-SchedulerCtrl.js
index f39ea54..30bf523 100755 (executable)
@@ -6,7 +6,9 @@ myApp.factory('$exceptionHandler', function () {
     return function (exception, cause) {\r
         if (exception.message.contains('leases')) {\r
             console.log(exception.message);\r
-            angular.element(document.getElementById('SchedulerCtrl')).scope().initSlots(_schedulerCurrentCellPosition, _schedulerCurrentCellPosition + SchedulerTotalVisibleCells);\r
+            \r
+            var tmpScope = angular.element(document.getElementById('SchedulerCtrl')).scope();\r
+            tmpScope.initSlots(_schedulerCurrentCellPosition, _schedulerCurrentCellPosition + SchedulerTotalVisibleCells);\r
         }\r
             \r
     };\r
@@ -72,14 +74,18 @@ myApp.factory('$exceptionHandler', function () {
             });\r
         };\r
 \r
-        $scope.initSlots = function(from, to) {\r
-            //init\r
-            $scope.slots = [];\r
-            for (var k = 0; k < SchedulerData.length; k++) {\r
+        $scope.SetSchedulerResources = function (start, to, filter) {\r
+            for (var k = start; k < to; k++) {\r
                 if ($scope.resources.length < SchedulerData.length)\r
                     $scope.resources.push(jQuery.extend(true, {}, SchedulerData[k]));\r
                 $scope.resources[k].leases = [];\r
             }\r
+            $scope.initSlots(0, SchedulerTotalVisibleCells);\r
+        };\r
+\r
+        $scope.initSlots = function(from, to) {\r
+            //init\r
+            $scope.slots = [];\r
             //set\r
             for (var i = from; i < to; i++) {\r
                 $scope.slots.push(SchedulerSlots[i]);\r