diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index eb1e6ac..2e558f1 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -9525,33 +9525,23 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.LayerChangeBasedOnKeyPressed = function (e) { - // Dissectible Anatomy > Should not display blank page if no layer is selected. - - - if (e.keyCode == 13) { - - if ($("#txtlayerNumber").val() == '') { - - $("#txtlayerNumber").val($rootScope.PreviouslayerNumbr); - } - else { - $rootScope.PreviouslayerNumbr = $("#txtlayerNumber").val(); - $scope.LayerChange(); - } - - - } // 'x' button is displaying inside the input box in IE browser. if (e.keyCode == 38) { - var layerInputVal = $("#txtlayerNumber").val(); - if (layerInputVal != $rootScope.totalLayers) { + + if (layerInputVal < $rootScope.totalLayers) { + var layerInputValInc = parseInt(layerInputVal) + 1; $scope.layerNumber = parseInt(layerInputValInc); $("#txtlayerNumber").val($scope.layerNumber); $rootScope.PreviouslayerNumbr = $scope.layerNumber; + + } + else { + + $("#txtlayerNumber").val($rootScope.totalLayers); } @@ -9559,12 +9549,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // 'x' button is displaying inside the input box in IE browser. if (e.keyCode == 40) { + var layerInputVal = $("#txtlayerNumber").val(); if (layerInputVal > 0) { var layerInputValDec = parseInt(layerInputVal) - 1; $scope.layerNumber = parseInt(layerInputValDec); $("#txtlayerNumber").val($scope.layerNumber); $rootScope.PreviouslayerNumbr = $scope.layerNumber; + } } @@ -9573,31 +9565,54 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.LayerValueChangeBasedOnKeyUp = function (e) { - var keyUplayerNumber = parseInt($("#txtlayerNumber").val()); - - if (isNaN(keyUplayerNumber)) - { - document.getElementById("txtlayerNumber").value = ""; - } - else { - - if (keyUplayerNumber > $rootScope.totalLayers) { + + if (e.keyCode == 13) { - $("#txtlayerNumber").val($rootScope.totalLayers); - $scope.layerNumber = parseInt($rootScope.totalLayers); + if ($("#txtlayerNumber").val() == '') { + $("#txtlayerNumber").val($rootScope.PreviouslayerNumbr); } else { - $("#txtlayerNumber").val(keyUplayerNumber); - $scope.layerNumber = parseInt(keyUplayerNumber); + $rootScope.PreviouslayerNumbr = $("#txtlayerNumber").val(); + var keyUplayerNumber = parseInt($("#txtlayerNumber").val()); - } + if (isNaN(keyUplayerNumber)) { + document.getElementById("txtlayerNumber").value = ""; + } + else { - } + if (keyUplayerNumber > $rootScope.totalLayers) { + + $("#txtlayerNumber").val($rootScope.totalLayers); + $scope.layerNumber = parseInt($rootScope.totalLayers); + } + else { + $("#txtlayerNumber").val(keyUplayerNumber); + $scope.layerNumber = parseInt(keyUplayerNumber); + + + } + $scope.LayerChange(); + } + } + } + else { + var layerInputVal = $("#txtlayerNumber").val(); + + if (layerInputVal <= $rootScope.totalLayers) { + + $("#txtlayerNumber").val(layerInputVal); + + } + else { + + $("#txtlayerNumber").val($rootScope.totalLayers); + } + } }