X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=plugins%2Fscheduler2%2Fstatic%2Fjs%2Fscheduler-SchedulerCtrl.js;h=30bf52325d4e4009e77451b1f5a7b6bc6f7ae374;hb=67c9e8a9f6fbb8d9dcce7f3d2611a99b4363ae99;hp=f39ea54d550c5106ab781a081eacd7bfca9aca60;hpb=9de457f26ac33c7e00bb048a231f18a39697b457;p=unfold.git diff --git a/plugins/scheduler2/static/js/scheduler-SchedulerCtrl.js b/plugins/scheduler2/static/js/scheduler-SchedulerCtrl.js index f39ea54d..30bf5232 100755 --- a/plugins/scheduler2/static/js/scheduler-SchedulerCtrl.js +++ b/plugins/scheduler2/static/js/scheduler-SchedulerCtrl.js @@ -6,7 +6,9 @@ myApp.factory('$exceptionHandler', function () { return function (exception, cause) { if (exception.message.contains('leases')) { console.log(exception.message); - angular.element(document.getElementById('SchedulerCtrl')).scope().initSlots(_schedulerCurrentCellPosition, _schedulerCurrentCellPosition + SchedulerTotalVisibleCells); + + var tmpScope = angular.element(document.getElementById('SchedulerCtrl')).scope(); + tmpScope.initSlots(_schedulerCurrentCellPosition, _schedulerCurrentCellPosition + SchedulerTotalVisibleCells); } }; @@ -72,14 +74,18 @@ myApp.factory('$exceptionHandler', function () { }); }; - $scope.initSlots = function(from, to) { - //init - $scope.slots = []; - for (var k = 0; k < SchedulerData.length; k++) { + $scope.SetSchedulerResources = function (start, to, filter) { + for (var k = start; k < to; k++) { if ($scope.resources.length < SchedulerData.length) $scope.resources.push(jQuery.extend(true, {}, SchedulerData[k])); $scope.resources[k].leases = []; } + $scope.initSlots(0, SchedulerTotalVisibleCells); + }; + + $scope.initSlots = function(from, to) { + //init + $scope.slots = []; //set for (var i = from; i < to; i++) { $scope.slots.push(SchedulerSlots[i]);