Commit 732c3a648df35be11ae192d46d0f7b938ec11fee

Authored by Nikita Kulshreshtha
1 parent 8b239d0e

fixed this bug. need to test more

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -9527,32 +9527,35 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l @@ -9527,32 +9527,35 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
9527 $scope.LayerChangeBasedOnKeyPressed = function (e) { 9527 $scope.LayerChangeBasedOnKeyPressed = function (e) {
9528 // Dissectible Anatomy > Should not display blank page if no layer is selected. 9528 // Dissectible Anatomy > Should not display blank page if no layer is selected.
9529 9529
  9530 + // alert('key down')
  9531 + //if (e.keyCode == 13) {
9530 9532
9531 - if (e.keyCode == 13) { 9533 + // if ($("#txtlayerNumber").val() == '') {
9532 9534
9533 - if ($("#txtlayerNumber").val() == '') { 9535 + // $("#txtlayerNumber").val($rootScope.PreviouslayerNumbr);
  9536 + // }
  9537 + // else {
  9538 + // $rootScope.PreviouslayerNumbr = $("#txtlayerNumber").val();
  9539 + // $scope.LayerChange();
9534 9540
9535 - $("#txtlayerNumber").val($rootScope.PreviouslayerNumbr);  
9536 - }  
9537 - else {  
9538 - $rootScope.PreviouslayerNumbr = $("#txtlayerNumber").val();  
9539 - $scope.LayerChange();  
9540 - } 9541 + // }
9541 9542
9542 9543
9543 - } 9544 + //}
9544 9545
9545 // 'x' button is displaying inside the input box in IE browser. 9546 // 'x' button is displaying inside the input box in IE browser.
9546 if (e.keyCode == 38) { 9547 if (e.keyCode == 38) {
9547 9548
9548 -  
9549 var layerInputVal = $("#txtlayerNumber").val(); 9549 var layerInputVal = $("#txtlayerNumber").val();
9550 - if (layerInputVal != $rootScope.totalLayers) { 9550 + if (layerInputVal < $rootScope.totalLayers) {
9551 var layerInputValInc = parseInt(layerInputVal) + 1; 9551 var layerInputValInc = parseInt(layerInputVal) + 1;
9552 $scope.layerNumber = parseInt(layerInputValInc); 9552 $scope.layerNumber = parseInt(layerInputValInc);
9553 $("#txtlayerNumber").val($scope.layerNumber); 9553 $("#txtlayerNumber").val($scope.layerNumber);
9554 $rootScope.PreviouslayerNumbr = $scope.layerNumber; 9554 $rootScope.PreviouslayerNumbr = $scope.layerNumber;
9555 } 9555 }
  9556 + else {
  9557 + $("#txtlayerNumber").val($rootScope.totalLayers);
  9558 + }
9556 9559
9557 9560
9558 } 9561 }
@@ -9573,31 +9576,54 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l @@ -9573,31 +9576,54 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
9573 9576
9574 $scope.LayerValueChangeBasedOnKeyUp = function (e) { 9577 $scope.LayerValueChangeBasedOnKeyUp = function (e) {
9575 9578
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) { 9579 + // alert('key up')
  9580 + if (e.keyCode == 13) {
9585 9581
9586 - $("#txtlayerNumber").val($rootScope.totalLayers);  
9587 - $scope.layerNumber = parseInt($rootScope.totalLayers); 9582 + if ($("#txtlayerNumber").val() == '') {
9588 9583
  9584 + $("#txtlayerNumber").val($rootScope.PreviouslayerNumbr);
9589 } 9585 }
9590 else { 9586 else {
  9587 + $rootScope.PreviouslayerNumbr = $("#txtlayerNumber").val();
9591 9588
9592 - $("#txtlayerNumber").val(keyUplayerNumber);  
9593 - $scope.layerNumber = parseInt(keyUplayerNumber);  
9594 9589
9595 9590
9596 - } 9591 + var keyUplayerNumber = parseInt($("#txtlayerNumber").val());
9597 9592
9598 - } 9593 + if (isNaN(keyUplayerNumber)) {
  9594 + document.getElementById("txtlayerNumber").value = "";
  9595 + }
  9596 + else {
  9597 +
  9598 + if (keyUplayerNumber > $rootScope.totalLayers) {
  9599 +
  9600 + $("#txtlayerNumber").val($rootScope.totalLayers);
  9601 + $scope.layerNumber = parseInt($rootScope.totalLayers);
  9602 +
  9603 + }
  9604 + else {
  9605 +
  9606 + $("#txtlayerNumber").val(keyUplayerNumber);
  9607 + $scope.layerNumber = parseInt(keyUplayerNumber);
9599 9608
9600 9609
  9610 + }
  9611 + $scope.LayerChange();
  9612 + }
  9613 + }
  9614 + }
  9615 + else {
  9616 + var layerInputVal = $("#txtlayerNumber").val();
  9617 + if (layerInputVal < $rootScope.totalLayers) {
  9618 + //var layerInputValInc = parseInt(layerInputVal) + 1;
  9619 + //$scope.layerNumber = parseInt(layerInputValInc);
  9620 + $("#txtlayerNumber").val(layerInputVal);
  9621 + //$rootScope.PreviouslayerNumbr = $scope.layerNumber;
  9622 + }
  9623 + else {
  9624 + $("#txtlayerNumber").val($rootScope.totalLayers);
  9625 + }
  9626 + }
9601 } 9627 }
9602 9628
9603 9629