Commit 8a03c74a58a8f884992a329f08a544d4f8be8ca3

Authored by Nikita Kulshreshtha
1 parent 6a923682

disabling UI on every action and enabling when the process is complete.

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -274,28 +274,31 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
274 274 };
275 275  
276 276 $scope.DisableUI = function () {
277   - alert('disable ui');
278 277 var daImagePanelConetent = document.getElementsByClassName("jsPanel-content");
279 278 for (var i = 0; i < daImagePanelConetent.length; i++) {
280 279 daImagePanelConetent[i].style.pointerEvents = "none";
  280 + daImagePanelConetent[i].style.opacity = "0.5";
  281 + // daImagePanelConetent[i].disabledUI
281 282 }
282 283  
283 284 }
284 285  
285 286 $scope.EnableUI = function () {
286   - alert('enable ui');
  287 +
287 288 var daImagePanelConetent = document.getElementsByClassName("jsPanel-content");
288 289 for (var i = 0; i < daImagePanelConetent.length; i++) {
289 290 daImagePanelConetent[i].style.pointerEvents = "auto";
  291 + daImagePanelConetent[i].style.opacity = "1";
290 292 }
291 293  
292   - alert('enable ui');
  294 +
293 295 }
294 296  
295 297 $scope.openView = function ($event) {
  298 + $scope.DisableUI();
  299 +
296 300 $rootScope.disableAnnotationTB = false;
297 301 $rootScope.MenuModuleName = "DA";
298   - //alert($rootScope.MenuModuleName);
299 302 $rootScope.isLoading = true;
300 303 $('#spinner').css('visibility', 'visible');
301 304  
... ... @@ -611,6 +614,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
611 614 }
612 615  
613 616 angular.element(document).ready(function (e) {
  617 +
614 618 $(document).on("click", "#daImagePanel .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () {
615 619 $rootScope.selectedBodySystemName = 'All';
616 620 $rootScope.selectedBodySystemId = 0;
... ... @@ -1752,12 +1756,12 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1752 1756 }
1753 1757 );
1754 1758 }
1755   - else if ($scope.ColoredImageSRC.length == totalCanvas)
1756   - {
1757   - // dispatch event for enabling rest UI
1758   - alert('all canvas drawn');
1759   - $scope.EnableUI();
1760   - }
  1759 + //else if ($scope.ColoredImageSRC.length == totalCanvas)
  1760 + //{
  1761 + // // dispatch event for enabling rest UI
  1762 + // alert('all canvas drawn');
  1763 + // $scope.EnableUI();
  1764 + //}
1761 1765  
1762 1766 //-NIKI-for solving extarct issue 8286
1763 1767  
... ... @@ -1808,6 +1812,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1808 1812 if ($scope.isExtract == true) {
1809 1813 $rootScope.isLoading = true;
1810 1814 $('#spinner').css('visibility', 'visible');
  1815 + $scope.DisableUI();
1811 1816 $scope.highLightBody();
1812 1817 }
1813 1818 else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true))
... ... @@ -1818,12 +1823,14 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1818 1823 $rootScope.isLoading = true;
1819 1824 $('#spinner').css('visibility', 'visible');
1820 1825 $rootScope.isHighLight = true;
  1826 + $scope.DisableUI();
1821 1827 $scope.highLightBody();
1822 1828 }
1823 1829 }
1824 1830 else {
1825 1831 $rootScope.isLoading = false;
1826 1832 $('#spinner').css('visibility', 'hidden');
  1833 + $scope.EnableUI();
1827 1834 }
1828 1835 }
1829 1836  
... ... @@ -2228,6 +2235,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2228 2235 if ($scope.isExtract == true) {
2229 2236 $rootScope.isLoading = true;
2230 2237 $('#spinner').css('visibility', 'visible');
  2238 + $scope.DisableUI();
2231 2239 $scope.highLightBody();
2232 2240 }
2233 2241 else if ($rootScope.isHighLight == true || ($rootScope.isListManagerSelected == true) || (($rootScope.isGenderChnage == true) && ($rootScope.isHighLight == true))
... ... @@ -2242,7 +2250,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2242 2250 $rootScope.isHighLight = true;
2243 2251  
2244 2252 console.log('just before highLightBody call');
2245   -
  2253 + $scope.DisableUI();
2246 2254 $scope.highLightBody();
2247 2255  
2248 2256 console.log('just after highLightBody call');
... ... @@ -2251,11 +2259,13 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2251 2259 else {
2252 2260 $rootScope.isLoading = false;
2253 2261 $('#spinner').css('visibility', 'hidden');
  2262 + $scope.EnableUI();
2254 2263 }
2255 2264 }
2256 2265 else {
2257 2266 $rootScope.isLoading = false;
2258 2267 $('#spinner').css('visibility', 'hidden');
  2268 + $scope.EnableUI();
2259 2269 }
2260 2270 }
2261 2271  
... ... @@ -2545,7 +2555,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2545 2555 //}
2546 2556  
2547 2557 if ($scope.doAligneCanvasWithTerm == true) {
2548   - $scope.aligneCanvasWithTerm()
  2558 + $scope.aligneCanvasWithTerm();
  2559 +
  2560 + $scope.EnableUI();
2549 2561 }
2550 2562  
2551 2563 // $timeout(function () { $scope.DisableProgressBar() }, 1000);
... ... @@ -2833,7 +2845,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
2833 2845  
2834 2846 $('#spinner').css('visibility', 'hidden');
2835 2847  
2836   -
  2848 + $scope.EnableUI();
2837 2849  
2838 2850 }
2839 2851 }
... ... @@ -3107,9 +3119,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3107 3119 $('#spinner').css('visibility', 'hidden')
3108 3120 $rootScope.isLoading = false;
3109 3121  
3110   - document.getElementById("daView").style.pointerEvents = "auto";
3111   - $('.ui-slider').slider('enable');
3112   -
  3122 + //document.getElementById("daView").style.pointerEvents = "auto";
  3123 + //$('.ui-slider').slider('enable');
  3124 + $scope.EnableUI();
3113 3125 prevBRID = TermExistInBodyRegionId;
3114 3126  
3115 3127 $scope.scrollToHighlightedBodyRegion(TermExistInBodyRegionId);
... ... @@ -3323,6 +3335,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3323 3335 //layer change function
3324 3336 $scope.LayerChange = function () {
3325 3337  
  3338 + $scope.DisableUI();
3326 3339  
3327 3340 //if listanager is visisble then close it
3328 3341 // $rootScope.isListManagerSelected = false;
... ... @@ -4385,6 +4398,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
4385 4398  
4386 4399 function mouseUpListener(e) {
4387 4400  
  4401 + $scope.DisableUI();
  4402 +
4388 4403 $scope.isTBDrawnOnBodyRegion = false;
4389 4404  
4390 4405 $(".com").remove();
... ... @@ -5326,6 +5341,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5326 5341  
5327 5342  
5328 5343 }
  5344 +
  5345 + $scope.EnableUI();
5329 5346 }
5330 5347  
5331 5348  
... ... @@ -6714,16 +6731,11 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6714 6731  
6715 6732 $scope.enableHighlight = function () {
6716 6733  
6717   -
6718   - // $("#btnExtract").removeClass("disabled");
6719   - // $("#btnTranparency").removeClass("disabled");
  6734 + $scope.DisableUI();
  6735 +
6720 6736 $("#btnTranparency").removeAttr('disabled', 'disabled');
6721   - // $rootScope.isTransparencyBoxActivated = false;
6722   - // $rootScope.isNormalMode = false;
6723 6737  
6724 6738 //if listanager is visisble then close it
6725   -
6726   - // $rootScope.isListManagerSelected = false;
6727 6739 $rootScope.CloseListManager();
6728 6740  
6729 6741  
... ... @@ -6732,7 +6744,6 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6732 6744 //to make the system highlight if the body systme highlighted than Normal and again highlight
6733 6745 $scope.isbodySystemHighlight = true;
6734 6746 }
6735   - // $rootScope.isHighlightBodyByBodySystem = false;
6736 6747  
6737 6748 if ($rootScope.isHighLight == true) {
6738 6749  
... ... @@ -6898,6 +6909,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
6898 6909  
6899 6910 $scope.enableExtract = function (isCalledFromButton) {
6900 6911  
  6912 + $scope.DisableUI();
  6913 +
6901 6914 console.log('isCalledFromButton= ' + isCalledFromButton);
6902 6915  
6903 6916 //$rootScope.isHighlightBodyByBodySystem = false;
... ... @@ -7251,6 +7264,10 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7251 7264 else {
7252 7265 $scope.isLoading = false;
7253 7266 $('#spinner').css('visibility', 'hidden');
  7267 +
  7268 + //for highlight when highlight button is clicked the ui got disabled,
  7269 + //now highlight is completed so enalbe UI
  7270 + $scope.EnableUI();
7254 7271 }
7255 7272  
7256 7273 }
... ... @@ -7531,6 +7548,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7531 7548  
7532 7549 $scope.OnGenderChange = function (event) {
7533 7550  
  7551 + $scope.DisableUI();
7534 7552  
7535 7553 var canvasDiv = document.getElementById('canvasDiv');
7536 7554 $scope.imageVerticalScrollPosition = canvasDiv.scrollTop;
... ... @@ -7771,8 +7789,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7771 7789 }
7772 7790  
7773 7791 $scope.OnViewChange = function (event) {
7774   - // alert(event.target.title);
7775   - // alert($("[title*='" + event.target.title + "']").parent().hasClass("active"));
  7792 +
  7793 + $scope.DisableUI();
  7794 +
7776 7795 if ($("[title*='" + event.target.title + "']").parent().hasClass("active") == true) {
7777 7796  
7778 7797  
... ... @@ -7997,6 +8016,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
7997 8016 //console.log('reloadDABodyViewEvent');
7998 8017 $rootScope.isGlobalSettingChanged = true;
7999 8018 if ($rootScope.isSettingEventAlredayDispachted == true) {
  8019 + $scope.DisableUI();
8000 8020 $rootScope.isSettingEventAlredayDispachted = false;
8001 8021 $scope.layerNumber = parseInt($('#txtlayerNumber').val());
8002 8022 //alert('mouseUp');
... ... @@ -8137,6 +8157,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8137 8157  
8138 8158 $scope.HighlightBodyByBodySystem = function (event) {
8139 8159  
  8160 + $scope.DisableUI();
  8161 +
8140 8162 //if listanager is visisble then close it
8141 8163  
8142 8164 $rootScope.isListManagerSelected = false;
... ... @@ -8709,7 +8731,9 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
8709 8731  
8710 8732  
8711 8733 $scope.HighlightBodyOnListManagerSelection = function (actualTermNumber, isTermListOptionClicked) {
8712   - //$rootScope.SelectedTermList = $("#termList").find("option[id=" + actualTermNumber + "]").val();
  8734 +
  8735 + $scope.DisableUI();
  8736 +
8713 8737 $rootScope.searchSelectedText = $("#" + actualTermNumber).text();
8714 8738 $rootScope.slectedActualTermNumber = actualTermNumber;
8715 8739  
... ...
400-SOURCECODE/AIAHTML5.Web/index.html
... ... @@ -317,7 +317,7 @@
317 317 </div>>
318 318  
319 319  
320   - <!--list manager Modal-->
  320 +
321 321 <div class="modal fade" id="ShowListManager" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" ng-init="tab = 1" style="width:27%;left:50%;overflow:hidden;height:500px;top:100px">
322 322 <div class="modal-dialog" role="document" style="width:400px;">
323 323 <div class="modal-content" style="width:100%;max-width:400px;">
... ...