Commit dd0be099f85a2f31a1ca3df37883cf9fb077d0d8

Authored by Nikita Kulshreshtha
2 parents 5a28541d 76312e57

Merge branch 'LMScroll1' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -1459,10 +1459,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1459 1459 {
1460 1460 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) {
1461 1461  
1462   - $rootScope.isLoading = false;
1463   - $('#spinner').css('visibility', 'hidden');
1464   -
1465   -
1466 1462 $rootScope.isLoading = true;
1467 1463 $('#spinner').css('visibility', 'visible');
1468 1464 //$timeout(function () {
... ... @@ -1785,13 +1781,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1785 1781  
1786 1782 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) {
1787 1783  
1788   - $rootScope.isLoading = false;
1789   - $('#spinner').css('visibility', 'hidden');
1790   -
1791 1784  
1792 1785 $rootScope.isLoading = true;
1793 1786 $('#spinner').css('visibility', 'visible');
1794   - //$timeout(function () {
  1787 +
1795 1788 console.log('inside start of non flipped. $scope.ColoredImageSRC.length= ' + $scope.ColoredImageSRC.length)
1796 1789 $rootScope.isHighLight = true;
1797 1790  
... ... @@ -1800,7 +1793,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1800 1793 $scope.highLightBody();
1801 1794  
1802 1795 console.log('just after highLightBody call');
1803   - //}, 500);
  1796 +
1804 1797 }
1805 1798 }
1806 1799 }
... ... @@ -2059,6 +2052,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2059 2052 // $rootScope.updatedGrayDataList = null;
2060 2053 // $rootScope.updatedGrayDataList = [];
2061 2054 //}
  2055 + $rootScope.isLoading = true;
  2056 + $('#spinner').css('visibility', 'visible');
  2057 +
2062 2058  
2063 2059 if ($rootScope.isHighLight == true) {
2064 2060 false;
... ... @@ -5033,6 +5029,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5033 5029  
5034 5030 $scope.highLightBody = function () {
5035 5031  
  5032 + $rootScope.isLoading = true;
  5033 + $('#spinner').css('visibility', 'visible');
  5034 +
5036 5035 $scope.Normal = "";
5037 5036 $scope.Extract = "";
5038 5037 $scope.Highlight = "LeftButtonsDefaultState";
... ... @@ -5216,6 +5215,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5216 5215 // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length);
5217 5216 $timeout(function () {
5218 5217  
  5218 + $scope.isLoading = true;
  5219 + $('#spinner').css('visibility', 'visible');
  5220 +
5219 5221 $scope.HighlightBodyByTermList($scope.AllTerms)
5220 5222 }, 800);
5221 5223  
... ... @@ -7170,7 +7172,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7170 7172  
7171 7173 $scope.jumpToTerm = function (event) {
7172 7174  
7173   -
  7175 + $rootScope.isLoading = true;
  7176 +
  7177 + $('#spinner').css('visibility', 'visible');
7174 7178 //1.
7175 7179 $scope.searchFilter = event.currentTarget.innerHTML;
7176 7180  
... ... @@ -7248,7 +7252,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7248 7252  
7249 7253  
7250 7254  
7251   -
  7255 + $('#viewName').empty();
7252 7256 var currentView = localStorage.getItem("currentViewTitle");
7253 7257 var viewNmeHtml = '<option>' + currentView + '</option>'
7254 7258 $('#viewName').append(viewNmeHtml);
... ... @@ -7318,6 +7322,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7318 7322 for (var j = 0; j < $scope.VocabTermTxt.length; j++) {
7319 7323 var $el = $('<option ng-click=HighlightBodyOnListManagerSelection($event) id=' + $scope.VocabTermTxt[j]._ActualTermNumber + '>' + $scope.VocabTermTxt[j]._TermText + '</option>').appendTo('#termList')
7320 7324 $compile($el)($scope);
  7325 +
7321 7326 $rootScope.isLoading = false;
7322 7327 $('#spinner').css('visibility', 'hidden');
7323 7328 }
... ... @@ -7512,6 +7517,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7512 7517 }
7513 7518 }
7514 7519  
  7520 +
7515 7521 $scope.aligneCanvasWithTerm = function () {
7516 7522 console.log('aligneCanvasWithTerm')
7517 7523 var newX = parseInt($scope.scaleValue($scope.termCoordinate.x, $scope.zoomInOut, DA[0].ZOOM_TERM_DATA));
... ... @@ -7519,30 +7525,45 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7519 7525  
7520 7526 var canvasX = parseInt($('#canvasDiv').css('left'));
7521 7527 var canvasY = parseInt($('#canvasDiv').css('top'));
7522   - var canvasWidth = parseInt($('#canvasDiv').css('width'));
7523   - var canvasHeight = parseInt($('#canvasDiv').css('height'));
  7528 + var canvasHeight = $('#canvasDiv').height();
  7529 + var canvasWidth = $('#canvasDiv').width();
  7530 +
7524 7531 var canvasBottom = canvasY + canvasHeight;
7525 7532 var canvasRight = canvasX + canvasWidth
7526 7533  
7527   -
7528   - if (newX >= canvasX && newX <= canvasRight && newY >= canvasY && newY <= canvasBottom) {
7529   -
7530   - }
7531   - else {
  7534 + if (newX < canvasX || newX > canvasRight || newY < canvasY || newY > canvasBottom) {
  7535 +
7532 7536 newX = newX - canvasWidth / 2;
7533 7537 newY = newY - canvasHeight / 2;
7534 7538  
7535   - }
  7539 + var maxVScrollPos = $('#canvasDiv')[0].scrollHeight;
  7540 + var maxHScrollPos = $('#canvasDiv')[0].scrollWidth;
7536 7541  
  7542 + if (newY < maxVScrollPos) {
  7543 + newY = newY;
  7544 + }
  7545 + else {
  7546 + newY = maxVScrollPos;
  7547 + }
  7548 +
  7549 + if (newX < maxHScrollPos) {
  7550 + newX = newX;
  7551 + }
  7552 + else {
  7553 + newX = maxHScrollPos;
  7554 + }
7537 7555  
  7556 + $('#canvasDiv').scrollLeft(newX);
  7557 + $('#canvasDiv').scrollTop(newY);
7538 7558  
7539   - console.log('newX =' + newX + ',newY= ' + newY)
7540   - $rootScope.xOnSearch= $('#canvasDiv').scrollLeft(newX);
7541   - $rootScope.yOnSearch = $('#canvasDiv').scrollTop(newY);
  7559 + }
7542 7560  
7543 7561  
  7562 + $scope.isLoading = false;
  7563 + $('#spinner').css('visibility', 'hidden');
7544 7564 }
7545 7565  
  7566 +
7546 7567 $scope.scaleValue = function (nValue, nNewZoom, nExistingZoom) {
7547 7568  
7548 7569 var iReturnValue = nValue * nNewZoom;
... ...
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... ... @@ -441,6 +441,10 @@ AIA.controller(&quot;HomeController&quot;, [&quot;$rootScope&quot;, &quot;Modules&quot;, &quot;$log&quot;, &quot;$location&quot;,
441 441 //$rootScope.isListManagerSelected = false;
442 442 $('#listManager').css('display', 'none');
443 443 $("#listManager").css("visibility", "hidden");
  444 +
  445 + $rootScope.isLoading = false;
  446 + $('#spinner').css('visibility', 'hidden');
  447 + //$('#spinner').css('display', 'none');
444 448 // $rootScope.isAnnotationWindowClose = true;
445 449 // if('#termList')
446 450 if ($('#termList option').length > 0) {
... ...