From 8a03c74a58a8f884992a329f08a544d4f8be8ca3 Mon Sep 17 00:00:00 2001 From: nikita Date: Thu, 23 Nov 2017 17:56:21 +0530 Subject: [PATCH] disabling UI on every action and enabling when the process is complete. --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------- 400-SOURCECODE/AIAHTML5.Web/index.html | 2 +- 2 files changed, 52 insertions(+), 28 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 8ddc49a..6a96b99 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -274,28 +274,31 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l }; $scope.DisableUI = function () { - alert('disable ui'); var daImagePanelConetent = document.getElementsByClassName("jsPanel-content"); for (var i = 0; i < daImagePanelConetent.length; i++) { daImagePanelConetent[i].style.pointerEvents = "none"; + daImagePanelConetent[i].style.opacity = "0.5"; + // daImagePanelConetent[i].disabledUI } } $scope.EnableUI = function () { - alert('enable ui'); + var daImagePanelConetent = document.getElementsByClassName("jsPanel-content"); for (var i = 0; i < daImagePanelConetent.length; i++) { daImagePanelConetent[i].style.pointerEvents = "auto"; + daImagePanelConetent[i].style.opacity = "1"; } - alert('enable ui'); + } $scope.openView = function ($event) { + $scope.DisableUI(); + $rootScope.disableAnnotationTB = false; $rootScope.MenuModuleName = "DA"; - //alert($rootScope.MenuModuleName); $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); @@ -611,6 +614,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } angular.element(document).ready(function (e) { + $(document).on("click", "#daImagePanel .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () { $rootScope.selectedBodySystemName = 'All'; $rootScope.selectedBodySystemId = 0; @@ -1752,12 +1756,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } ); } - else if ($scope.ColoredImageSRC.length == totalCanvas) - { - // dispatch event for enabling rest UI - alert('all canvas drawn'); - $scope.EnableUI(); - } + //else if ($scope.ColoredImageSRC.length == totalCanvas) + //{ + // // dispatch event for enabling rest UI + // alert('all canvas drawn'); + // $scope.EnableUI(); + //} //-NIKI-for solving extarct issue 8286 @@ -1808,6 +1812,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($scope.isExtract == true) { $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); + $scope.DisableUI(); $scope.highLightBody(); } else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) @@ -1818,12 +1823,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); $rootScope.isHighLight = true; + $scope.DisableUI(); $scope.highLightBody(); } } else { $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); + $scope.EnableUI(); } } @@ -2228,6 +2235,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($scope.isExtract == true) { $rootScope.isLoading = true; $('#spinner').css('visibility', 'visible'); + $scope.DisableUI(); $scope.highLightBody(); } else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true)) @@ -2242,7 +2250,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.isHighLight = true; console.log('just before highLightBody call'); - + $scope.DisableUI(); $scope.highLightBody(); console.log('just after highLightBody call'); @@ -2251,11 +2259,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l else { $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); + $scope.EnableUI(); } } else { $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); + $scope.EnableUI(); } } @@ -2545,7 +2555,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //} if ($scope.doAligneCanvasWithTerm == true) { - $scope.aligneCanvasWithTerm() + $scope.aligneCanvasWithTerm(); + + $scope.EnableUI(); } // $timeout(function () { $scope.DisableProgressBar() }, 1000); @@ -2833,7 +2845,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#spinner').css('visibility', 'hidden'); - + $scope.EnableUI(); } } @@ -3107,9 +3119,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#spinner').css('visibility', 'hidden') $rootScope.isLoading = false; - document.getElementById("daView").style.pointerEvents = "auto"; - $('.ui-slider').slider('enable'); - + //document.getElementById("daView").style.pointerEvents = "auto"; + //$('.ui-slider').slider('enable'); + $scope.EnableUI(); prevBRID = TermExistInBodyRegionId; $scope.scrollToHighlightedBodyRegion(TermExistInBodyRegionId); @@ -3323,6 +3335,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //layer change function $scope.LayerChange = function () { + $scope.DisableUI(); //if listanager is visisble then close it // $rootScope.isListManagerSelected = false; @@ -4385,6 +4398,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l function mouseUpListener(e) { + $scope.DisableUI(); + $scope.isTBDrawnOnBodyRegion = false; $(".com").remove(); @@ -5326,6 +5341,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } + + $scope.EnableUI(); } @@ -6714,16 +6731,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.enableHighlight = function () { - - // $("#btnExtract").removeClass("disabled"); - // $("#btnTranparency").removeClass("disabled"); + $scope.DisableUI(); + $("#btnTranparency").removeAttr('disabled', 'disabled'); - // $rootScope.isTransparencyBoxActivated = false; - // $rootScope.isNormalMode = false; //if listanager is visisble then close it - - // $rootScope.isListManagerSelected = false; $rootScope.CloseListManager(); @@ -6732,7 +6744,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //to make the system highlight if the body systme highlighted than Normal and again highlight $scope.isbodySystemHighlight = true; } - // $rootScope.isHighlightBodyByBodySystem = false; if ($rootScope.isHighLight == true) { @@ -6898,6 +6909,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.enableExtract = function (isCalledFromButton) { + $scope.DisableUI(); + console.log('isCalledFromButton= ' + isCalledFromButton); //$rootScope.isHighlightBodyByBodySystem = false; @@ -7251,6 +7264,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l else { $scope.isLoading = false; $('#spinner').css('visibility', 'hidden'); + + //for highlight when highlight button is clicked the ui got disabled, + //now highlight is completed so enalbe UI + $scope.EnableUI(); } } @@ -7531,6 +7548,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.OnGenderChange = function (event) { + $scope.DisableUI(); var canvasDiv = document.getElementById('canvasDiv'); $scope.imageVerticalScrollPosition = canvasDiv.scrollTop; @@ -7771,8 +7789,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.OnViewChange = function (event) { - // alert(event.target.title); - // alert($("[title*='" + event.target.title + "']").parent().hasClass("active")); + + $scope.DisableUI(); + if ($("[title*='" + event.target.title + "']").parent().hasClass("active") == true) { @@ -7997,6 +8016,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l //console.log('reloadDABodyViewEvent'); $rootScope.isGlobalSettingChanged = true; if ($rootScope.isSettingEventAlredayDispachted == true) { + $scope.DisableUI(); $rootScope.isSettingEventAlredayDispachted = false; $scope.layerNumber = parseInt($('#txtlayerNumber').val()); //alert('mouseUp'); @@ -8137,6 +8157,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.HighlightBodyByBodySystem = function (event) { + $scope.DisableUI(); + //if listanager is visisble then close it $rootScope.isListManagerSelected = false; @@ -8709,7 +8731,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.HighlightBodyOnListManagerSelection = function (actualTermNumber, isTermListOptionClicked) { - //$rootScope.SelectedTermList = $("#termList").find("option[id=" + actualTermNumber + "]").val(); + + $scope.DisableUI(); + $rootScope.searchSelectedText = $("#" + actualTermNumber).text(); $rootScope.slectedActualTermNumber = actualTermNumber; diff --git a/400-SOURCECODE/AIAHTML5.Web/index.html b/400-SOURCECODE/AIAHTML5.Web/index.html index c23caff..4f648fa 100644 --- a/400-SOURCECODE/AIAHTML5.Web/index.html +++ b/400-SOURCECODE/AIAHTML5.Web/index.html @@ -317,7 +317,7 @@ > - +