Commit 2988be2fd9ebb2219883d0c424f5572b79b3c316

Authored by Nikita Kulshreshtha
1 parent 215458c0

Refs: #7347

LM and search scroll issue is fixed.
Also found new defect that the View anme is list manger was static.
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -1392,8 +1392,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1392 1392 if ($scope.isEligibleForHighlight == true) {
1393 1393 if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) || (($rootScope.isViewChange == true) && ($rootScope.isHighLight == true))) {
1394 1394  
1395   - $rootScope.isLoading = false;
1396   - $('#spinner').css('visibility', 'hidden');
  1395 + //$rootScope.isLoading = false;
  1396 + //$('#spinner').css('visibility', 'hidden');
1397 1397  
1398 1398  
1399 1399 $rootScope.isLoading = true;
... ... @@ -2151,6 +2151,38 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2151 2151 grayCanvasContext.putImageData(updatedData, 0, 0);
2152 2152 $scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId });
2153 2153  
  2154 +
  2155 + console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length)
  2156 +
  2157 + if ($scope.highlightedBR != null || $scope.highlightedBR != undefined) {
  2158 +
  2159 + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.highlightedBR.length == 9)) {
  2160 + $scope.doAligneCanvasWithTerm = true;
  2161 + }
  2162 + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.highlightedBR.length == 5)) {
  2163 + $scope.doAligneCanvasWithTerm = true;
  2164 + }
  2165 + else if ((($rootScope.viewOrientationId == '5')) && ($scope.highlightedBR.length == 1)) {
  2166 + $scope.doAligneCanvasWithTerm = true;
  2167 + }
  2168 + else if ((($rootScope.viewOrientationId == '6')) && ($scope.highlightedBR.length == 1)) {
  2169 + $scope.doAligneCanvasWithTerm = true;
  2170 + }
  2171 +
  2172 + if ($scope.doAligneCanvasWithTerm == true) {
  2173 + //debugger;
  2174 + if ($scope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true)
  2175 +
  2176 + $rootScope.isLoading = false;
  2177 +
  2178 + $('#spinner').css('visibility', 'hidden');
  2179 +
  2180 + $scope.isHighlightBodyByBodySystem = false;
  2181 +
  2182 + if ($rootScope.isListManagerSelected == true)
  2183 + $scope.aligneCanvasWithTerm();
  2184 + }
  2185 + }
2154 2186 }
2155 2187  
2156 2188 //debugger;
... ... @@ -2167,37 +2199,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
2167 2199  
2168 2200 //$scope.highlightedBR.push({ 'bodyRegionId': bodyRegionId });
2169 2201  
2170   - console.log('$scope.highlightedBR.length= ' + $scope.highlightedBR.length)
2171   -
2172   - if ($scope.highlightedBR != null || $scope.highlightedBR != undefined) {
2173   -
2174   - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.highlightedBR.length == 9)) {
2175   - $scope.doAligneCanvasWithTerm = true;
2176   - }
2177   - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.highlightedBR.length == 5)) {
2178   - $scope.doAligneCanvasWithTerm = true;
2179   - }
2180   - else if ((($rootScope.viewOrientationId == '5')) && ($scope.highlightedBR.length == 4)) {
2181   - $scope.doAligneCanvasWithTerm = true;
2182   - }
2183   - else if ((($rootScope.viewOrientationId == '6')) && ($scope.highlightedBR.length == 1)) {
2184   - $scope.doAligneCanvasWithTerm = true;
2185   - }
2186   -
2187   - if ($scope.doAligneCanvasWithTerm == true) {
2188   - //debugger;
2189   - if ($scope.isHighlightBodyByBodySystem == true || $rootScope.isListManagerSelected == true)
2190   -
2191   - $rootScope.isLoading = false;
2192   -
2193   - $('#spinner').css('visibility', 'hidden');
2194   -
2195   - $scope.isHighlightBodyByBodySystem = false;
2196   -
2197   - if ($rootScope.isListManagerSelected == true)
2198   - $scope.aligneCanvasWithTerm();
2199   - }
2200   - }
  2202 +
2201 2203 //
2202 2204  
2203 2205 };
... ... @@ -5088,7 +5090,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
5088 5090 $timeout(function () { $scope.HighlightBodyByTermList($scope.systemMatchedTermList) }, 100);
5089 5091 }
5090 5092 else if ($rootScope.isListManagerSelected == true) {
  5093 + $scope.isLoading = true;
5091 5094  
  5095 + $('#spinner').css('visibility', 'visible');
5092 5096 // console.log('$scope.grayedBR.length is ' + $scope.grayedBR.length);
5093 5097 $timeout(function () {
5094 5098  
... ... @@ -6970,9 +6974,8 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
6970 6974 $compile($elem)($scope);
6971 6975 })
6972 6976  
6973   -
6974   -
6975   -
  6977 +
  6978 + $('#viewName').empty();
6976 6979 var currentView = localStorage.getItem("currentViewTitle");
6977 6980 var viewNmeHtml = '<option>' + currentView + '</option>'
6978 6981 $('#viewName').append(viewNmeHtml);
... ... @@ -7240,28 +7243,59 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
7240 7243  
7241 7244 var canvasX = parseInt($('#canvasDiv').css('left'));
7242 7245 var canvasY = parseInt($('#canvasDiv').css('top'));
7243   - var canvasWidth = parseInt($('#canvasDiv').css('width'));
7244   - var canvasHeight = parseInt($('#canvasDiv').css('height'));
  7246 + //var canvasWidth = parseInt($('#canvasDiv').css('width'));
  7247 + // var canvasHeight = parseInt($('#canvasDiv').css('height'));
  7248 +
  7249 +
  7250 + var canvasHeight = $('#canvasDiv').height();
  7251 + var canvasWidth = $('#canvasDiv').width();
  7252 +
7245 7253 var canvasBottom = canvasY + canvasHeight;
7246 7254 var canvasRight = canvasX + canvasWidth
7247 7255  
  7256 + if (newX < canvasX || newX > canvasRight || newY < canvasY || newY > canvasBottom){
  7257 + //if (newX >= canvasX && newX <= canvasRight && newY >= canvasY && newY <= canvasBottom) {
  7258 +
  7259 + //}
  7260 + //else {
7248 7261  
7249   - if (newX >= canvasX && newX <= canvasRight && newY >= canvasY && newY <= canvasBottom) {
7250 7262  
7251   - }
7252   - else {
  7263 +
  7264 + console.log('aligneCanvasWithTerm IF')
  7265 + console.log('aligneCanvasWithTerm ELSE')
7253 7266 newX = newX - canvasWidth / 2;
7254 7267 newY = newY - canvasHeight / 2;
7255 7268  
  7269 + var maxVScrollPos = $('#canvasDiv')[0].scrollHeight;
  7270 + var maxHScrollPos = $('#canvasDiv')[0].scrollWidth;
  7271 +
  7272 + if (newY < maxVScrollPos) {
  7273 + newY = newY;
  7274 + }
  7275 + else {
  7276 + newY = maxVScrollPos;
  7277 + }
  7278 +
  7279 + //Conditions checked for Horizontal Scroll Position
  7280 + if (newX < maxHScrollPos) {
  7281 + newX = newX;
  7282 + }
  7283 + else {
  7284 + newX = maxHScrollPos;
  7285 + }
  7286 +
  7287 + $('#canvasDiv').scrollLeft(newX);
  7288 + $('#canvasDiv').scrollTop(newY);
  7289 +
7256 7290 }
7257 7291  
7258 7292  
7259 7293  
7260 7294 console.log('newX =' + newX + ',newY= ' + newY)
7261   - $('#canvasDiv').scrollLeft(newX);
7262   - $('#canvasDiv').scrollTop(newY);
7263   -
  7295 +
7264 7296  
  7297 + $scope.isLoading = false;
  7298 + $('#spinner').css('visibility', 'hidden');
7265 7299 }
7266 7300  
7267 7301 $scope.scaleValue = function (nValue, nNewZoom, nExistingZoom) {
... ...