Commit da1acabbb8b1e37288d07fecbd1756b7e89a85e9

Authored by Amrita Vishnoi
2 parents 3e7c0c43 6af76ba3

Merge branch 'AndroidLayerChangeIssue' into Develop-IPAD-MAC

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -9525,33 +9525,23 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
9525 9525 }
9526 9526  
9527 9527 $scope.LayerChangeBasedOnKeyPressed = function (e) {
9528   - // Dissectible Anatomy > Should not display blank page if no layer is selected.
9529   -
9530   -
9531   - if (e.keyCode == 13) {
9532   -
9533   - if ($("#txtlayerNumber").val() == '') {
9534   -
9535   - $("#txtlayerNumber").val($rootScope.PreviouslayerNumbr);
9536   - }
9537   - else {
9538   - $rootScope.PreviouslayerNumbr = $("#txtlayerNumber").val();
9539   - $scope.LayerChange();
9540   - }
9541   -
9542   -
9543   - }
9544 9528  
9545 9529 // 'x' button is displaying inside the input box in IE browser.
9546 9530 if (e.keyCode == 38) {
9547 9531  
9548   -
9549 9532 var layerInputVal = $("#txtlayerNumber").val();
9550   - if (layerInputVal != $rootScope.totalLayers) {
  9533 +
  9534 + if (layerInputVal < $rootScope.totalLayers) {
  9535 +
9551 9536 var layerInputValInc = parseInt(layerInputVal) + 1;
9552 9537 $scope.layerNumber = parseInt(layerInputValInc);
9553 9538 $("#txtlayerNumber").val($scope.layerNumber);
9554 9539 $rootScope.PreviouslayerNumbr = $scope.layerNumber;
  9540 +
  9541 + }
  9542 + else {
  9543 +
  9544 + $("#txtlayerNumber").val($rootScope.totalLayers);
9555 9545 }
9556 9546  
9557 9547  
... ... @@ -9559,12 +9549,14 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
9559 9549  
9560 9550 // 'x' button is displaying inside the input box in IE browser.
9561 9551 if (e.keyCode == 40) {
  9552 +
9562 9553 var layerInputVal = $("#txtlayerNumber").val();
9563 9554 if (layerInputVal > 0) {
9564 9555 var layerInputValDec = parseInt(layerInputVal) - 1;
9565 9556 $scope.layerNumber = parseInt(layerInputValDec);
9566 9557 $("#txtlayerNumber").val($scope.layerNumber);
9567 9558 $rootScope.PreviouslayerNumbr = $scope.layerNumber;
  9559 +
9568 9560 }
9569 9561 }
9570 9562  
... ... @@ -9573,31 +9565,54 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
9573 9565  
9574 9566 $scope.LayerValueChangeBasedOnKeyUp = function (e) {
9575 9567  
9576   - var keyUplayerNumber = parseInt($("#txtlayerNumber").val());
9577   -
9578   - if (isNaN(keyUplayerNumber))
9579   - {
9580   - document.getElementById("txtlayerNumber").value = "";
9581   - }
9582   - else {
9583   -
9584   - if (keyUplayerNumber > $rootScope.totalLayers) {
  9568 +
  9569 + if (e.keyCode == 13) {
9585 9570  
9586   - $("#txtlayerNumber").val($rootScope.totalLayers);
9587   - $scope.layerNumber = parseInt($rootScope.totalLayers);
  9571 + if ($("#txtlayerNumber").val() == '') {
9588 9572  
  9573 + $("#txtlayerNumber").val($rootScope.PreviouslayerNumbr);
9589 9574 }
9590 9575 else {
9591 9576  
9592   - $("#txtlayerNumber").val(keyUplayerNumber);
9593   - $scope.layerNumber = parseInt(keyUplayerNumber);
  9577 + $rootScope.PreviouslayerNumbr = $("#txtlayerNumber").val();
9594 9578  
  9579 + var keyUplayerNumber = parseInt($("#txtlayerNumber").val());
9595 9580  
9596   - }
  9581 + if (isNaN(keyUplayerNumber)) {
  9582 + document.getElementById("txtlayerNumber").value = "";
  9583 + }
  9584 + else {
9597 9585  
9598   - }
  9586 + if (keyUplayerNumber > $rootScope.totalLayers) {
  9587 +
  9588 + $("#txtlayerNumber").val($rootScope.totalLayers);
  9589 + $scope.layerNumber = parseInt($rootScope.totalLayers);
9599 9590  
  9591 + }
  9592 + else {
9600 9593  
  9594 + $("#txtlayerNumber").val(keyUplayerNumber);
  9595 + $scope.layerNumber = parseInt(keyUplayerNumber);
  9596 +
  9597 +
  9598 + }
  9599 + $scope.LayerChange();
  9600 + }
  9601 + }
  9602 + }
  9603 + else {
  9604 + var layerInputVal = $("#txtlayerNumber").val();
  9605 +
  9606 + if (layerInputVal <= $rootScope.totalLayers) {
  9607 +
  9608 + $("#txtlayerNumber").val(layerInputVal);
  9609 +
  9610 + }
  9611 + else {
  9612 +
  9613 + $("#txtlayerNumber").val($rootScope.totalLayers);
  9614 + }
  9615 + }
9601 9616 }
9602 9617  
9603 9618  
... ...