From c98dcf1c3dca914e006155a2728baa5e568bfe23 Mon Sep 17 00:00:00 2001 From: Birendra Date: Fri, 27 Mar 2020 19:13:51 +0530 Subject: [PATCH] fixed list manager for mutiple DA panel --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js | 6 ++++++ 400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js | 6 ++++++ 400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js | 6 +++++- 400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js | 5 +++++ 400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js | 40 ++++++++++++++++++++++++++++------------ 400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js | 142 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------- 400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js | 5 ++++- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 4 ++++ 8 files changed, 173 insertions(+), 41 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js index 9531749..d5d747d 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/3dAController.js @@ -494,6 +494,11 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location } $scope.JsPanelMouseEnter = function (windowviewid) { + + //reset option list manager and annotation + //call when module loaded + $rootScope.resetMenuOption(); + // call from while open module in CB //click event not work on object-tag document @@ -504,6 +509,7 @@ function ($scope, $rootScope, pages, log, $http, DataService, $filter, $location // var pnlName = event.currentTarget.id; //console.log('Mouse enter fired: ' + event.currentTarget.id); $scope.$emit("cBEnableDisableMenuOption", ""); + $rootScope.resetMenuOptionOnClick(""); }); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js index d3b040c..0f63552 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js @@ -1205,10 +1205,16 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.JsPanelclick = function (windowviewid) { + + //reset option list manager and annotation + //call when module loaded + $rootScope.resetMenuOption(); + // call from while open module in CB $("#aiImagePanel_" + windowviewid).on('click', function (event) { var pnlName = event.currentTarget.id; + $rootScope.resetMenuOptionOnClick(pnlName); $scope.$emit("cBEnableDisableMenuOption", pnlName); // store image for export while click on panel diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js index ee9f442..e34714a 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CAController.js @@ -959,9 +959,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.JsPanelclick = function (windowviewid) { + + //reset option list manager and annotation + //call when module loaded + $rootScope.resetMenuOption(); // call from while open module in CB $("#caImagePanel_" + windowviewid).on('click', function (event) { - + $rootScope.resetMenuOptionOnClick(""); // var pnlName = event.currentTarget.id; $scope.$emit("cBEnableDisableMenuOption", ""); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js index 18392bb..64af5ad 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/CIController.js @@ -1021,10 +1021,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout } $scope.JsPanelclick = function (windowviewid) { + //reset option list manager and annotation + //call when module loaded + $rootScope.resetMenuOption(); + // call from while open module in CB $("#ciImagePanel_" + windowviewid).on('click', function (event) { var pnlName = event.currentTarget.id; + $rootScope.resetMenuOptionOnClick(pnlName); $scope.$emit("cBEnableDisableMenuOption", pnlName); // store image for export while click on panel diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 6b25102..23fc862 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -1040,9 +1040,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.JsPanelclick = function (windowviewid) { + //reset option list manager and annotation + //call when module loaded + $rootScope.resetMenuOption(); $("#daImagePanel_" + windowviewid).on('click', function (event) { var pnlName=event.currentTarget.id; + $rootScope.resetMenuOptionOnClick(pnlName); $scope.$emit("cBEnableDisableMenuOption",pnlName); // store image for export while click on panel @@ -1406,6 +1410,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $(this).attr("selected", true); }); + $("#termList").unbind('keyup'); + $("#termList").on('keyup', function (event) { + $('#termList option[selected="selected"]').attr("selected", false); + $(this.selectedOptions[0]).attr("selected", true); + }); + $(document).keypress(function (e) { if ($('#termList option[selected="selected"]').attr("id") == "undefined") { return false; @@ -9135,14 +9145,14 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } //clsoe worker process - $scope.$on('jsPanelCloseEvent', function (event, data) { - console.log('terminate worker process') - //terminate previous running workers to create space for new workers - $rootScope.isLoading = false; - $('#spinner').css('visibility', 'hidden'); + // $scope.$on('jsPanelCloseEvent', function (event, data) { + // console.log('terminate worker process') + // //terminate previous running workers to create space for new workers + // $rootScope.isLoading = false; + // $('#spinner').css('visibility', 'hidden'); - $rootScope.CloseListManager(); - }) + // $rootScope.CloseListManager(); + // }) $scope.loadSelectedBodyView = function (currentBodyViewId, windowviewid) { var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList'); @@ -9910,6 +9920,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $timeout(function () { $("#termlistfilter_" + windowviewid).css("display", "none"); + if ($('#searchListDiv_' + windowviewid).html() != "") { + $('#searchListDiv_' + windowviewid).empty(); + } }, 500); @@ -9926,8 +9939,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.searchSelectedText =currenttermidTxt; //using at home controller $scope.SetwindowStoreData(windowviewid,'searchSelectedText',currenttermidTxt); - $('#termList option[selected="selected"]').prop("selected", false); - $('#termList option[value="' + currenttermidTxt + '"]').prop("selected", true); + $('#termList option[selected="selected"]').attr("selected", false); + $('#termList option[value="' + currenttermidTxt + '"]').attr("selected", true); $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); $('#termList option[value="' + currenttermidTxt + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); @@ -10109,7 +10122,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l var $el = $('').appendTo('#termList') $compile($el)($scope); - } + } $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); @@ -10118,8 +10131,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $("#totalTerms").empty(); $('#totalTerms').append(termsTotal); - - } } else { @@ -10601,6 +10612,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#totalTerms').append(termsTotal); $rootScope.isLoading = false; $('#spinner').css('visibility', 'hidden'); + } }) @@ -10830,6 +10842,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#searchedTermListPopUp_' + windowviewid).css('display', 'none'); $('#searchedTermListPopUp_' + windowviewid).css("visibility", "hidden"); + if ($('#searchTermListUl_' + windowviewid).html() != "") { + $('#searchTermListUl_' + windowviewid).empty(); + } + } diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 4c54409..84c3c16 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -120,15 +120,16 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.CloseListManager(); $rootScope.CloseAnnotationTool(); - - // close list opened in DA - // var searchedTermListPopUp = $("#HomeContainerDiv").find("div[id*='searchedTermListPopUp']"); - // - // for (var i = 0 ; i < searchedTermListPopUp.length; i++) { - // // var windowviewid = (searchedTermListPopUp[i].id).split('_')[1]; - // // $('#searchedTermListPopUp_' + windowviewid).css('display', 'none'); - // // $('#searchedTermListPopUp_' + windowviewid).css("visibility", "hidden"); - // } + + // close list if opened in DA + var searchedTermListPopUp = $("#HomeContainerDiv").find("div[id*='searchedTermListPopUp']"); + + for (var i = 0 ; i < searchedTermListPopUp.length; i++) { + var windowviewid = (searchedTermListPopUp[i].id).split('_')[1]; + $('#searchedTermListPopUp_' + windowviewid).css('display', 'none'); + $('#searchedTermListPopUp_' + windowviewid).css("visibility", "hidden"); + $('#searchTermListUl_' + windowviewid).empty(); + } sessionStorage.setItem('isModuleOpenByOpenResource', 'true'); @@ -1648,7 +1649,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data return moduleUrl === currentRoute ? 'active' : ''; } $("#annotationToolBarOptions").removeClass("disableMenuoption"); - $("#optionsListManagerTab").removeClass("disableMenuoption"); + $("#optionsListManagerTab").removeClass("disableSubMenu"); $("#optiontSetting").removeClass("disableSubMenu"); var userInformation = $rootScope.userData; @@ -1867,6 +1868,57 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data return paneltopPosition; } +//reset option list manager and annotation when load +//call also when close module + $rootScope.resetMenuOption = function () { + $timeout(function () { + var islistManagerActive=false; + if ($location.url() != "/curriculum-builder-detail") { + var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']"); + if (modulePanel != undefined && modulePanel.length>0) { + for (var i = 0 ; i < modulePanel.length; i++) { + var paneld = modulePanel[i].id; + if(paneld.match('daImagePanel')||paneld.match('AAImagePanel')) + { + islistManagerActive=true; + } + } + } + if(islistManagerActive==true) + { + $("#optionsListManagerTab").removeClass("disableSubMenu"); + } + else + { + $("#optionsListManagerTab").addClass("disableSubMenu"); + } + } + }, 500); + } + + // enable/disable list manager option and annotation Panel click +$rootScope.resetMenuOptionOnClick = function (moduleName) { + if ($location.url() != "/curriculum-builder-detail") { + if (moduleName != "") { + if(moduleName.match('daImagePanel')||moduleName.match('AAImagePanel')) + { + $("#optionsListManagerTab").removeClass("disableSubMenu"); + } + else + { + $("#optionsListManagerTab").addClass("disableSubMenu"); + } + } + else + { + $("#optionsListManagerTab").addClass("disableSubMenu"); + } + + $scope.ListManagerViewDisableEnable(moduleName); + } + +} + // CB: reset panel top position when if any module closed $rootScope.resetjsPanelTop = function () { @@ -1876,7 +1928,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data firsttopPosition = 680; } - + var islistManagerActive=false; var moduleImagePanel = $("div[id*='ImagePanel']"); if (moduleImagePanel.length > 0) { @@ -1896,11 +1948,35 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $("#" + lastpanel.id).css("top", lastTop + 'px'); } + //Reset menu option like list manager,annotation when close module + + if ($location.url() != "/curriculum-builder-detail") { + var paneld = moduleImagePanel[index].id; + if(paneld.match('daImagePanel')||paneld.match('AAImagePanel')) + { + islistManagerActive=true; + } + } + } } - }, 500); + if ($location.url() != "/curriculum-builder-detail") { + if(islistManagerActive==true) + { + $("#optionsListManagerTab").removeClass("disableSubMenu"); + + } + else + { + $("#optionsListManagerTab").addClass("disableSubMenu"); + + } + // list manger already open then refresh it or close + $scope.updateListManagerView(); + } + }, 500); } @@ -1933,10 +2009,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $('#printAVAnchor').parent().addClass('PrintViewer'); $('#printAllAVAnchor').parent().addClass('PrintViewer'); $('#printPreviewAnchor').parent().addClass('PrintPreview'); - } - }); @@ -1977,7 +2051,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $location.url('/' + slug); - $rootScope.$broadcast('jsPanelCloseEvent', true); + // $rootScope.$broadcast('jsPanelCloseEvent', true); } } @@ -5709,26 +5783,40 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } //list manager function - - //list manager function + $scope.ListManagerViewDisableEnable = function (moduleName) { + if(moduleName.match('daImagePanel')||moduleName.match('AAImagePanel')) + { + $("#listManagerBody *").prop('disabled',false); + } + else + { + $("#listManagerBody *").prop('disabled',true); + } + + } $scope.updateListManagerView = function () { - $("#listManagerBody *").prop('disabled',true); + $("#listManagerBody *").prop('disabled',false); + $("#listManagerContent *").prop('disabled',true); $('#AABodySystems').empty(); $('#bodySystems').empty(); $('#termList').empty(); $('#viewName').empty(); $('#viewName').append(''); - + var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']").not("div[id*='caImagePanel']").not("div[id*='ThreeDImagePanel']").not("div[id*='ciImagePanel']").not("div[id*='aiImagePanel']").not("div[id*='labImagePanel']"); - if (modulePanel != undefined && modulePanel != null) { + if (modulePanel != undefined && modulePanel.length>0) { for (var i = 0 ; i < modulePanel.length; i++) { var paneld = modulePanel[i].id; var panelTitle = document.getElementById(paneld).childNodes[0].innerText; $('#viewName').append(''); } } + else + { + $rootScope.CloseListManager(); + } } @@ -5744,7 +5832,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $('#viewName').append(''); var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']").not("div[id*='caImagePanel']").not("div[id*='ThreeDImagePanel']").not("div[id*='ciImagePanel']").not("div[id*='aiImagePanel']").not("div[id*='labImagePanel']"); - if (modulePanel != undefined && modulePanel != null) { + if (modulePanel != undefined && modulePanel.length>0) { for (var i = 0 ; i < modulePanel.length; i++) { var paneld = modulePanel[i].id; var panelTitle = document.getElementById(paneld).childNodes[0].innerText; @@ -5801,11 +5889,11 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.islistManagerEventAlredayDispachted = true; $rootScope.$broadcast('listManagerEvent', windowviewid); - + if ($rootScope.selectedBodySystemName == undefined && $rootScope.slectedActualTermNumber == undefined) { if ($location.path() == "/module-item-view") { $timeout(function () { - $('#termList option[selected="selected"]').prop("selected", false); + // $('#termList option[selected="selected"]').prop("selected", false); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').prop("selected", true); $("#termList").find("option").css({ "background-color": "#ffffff", "color": "#000000" }); $('#termList option[value="' + $rootScope.searchSelectedText + '"]').css({ "background-color": "#3399FF", "color": "#ffffff" }); @@ -5857,7 +5945,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data // // }, 500); } - $("#optionsListManagerTab").addClass("active"); + // $("#optionsListManagerTab").addClass("active"); // var viewNameAftrSplit; //if ($("#viewName").val() !== null) { // viewNameAftrSplit = $("#viewName").val().split(" "); @@ -5895,7 +5983,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var canvasPaintId = canvasPaintElement.id; - $("#optionsListManagerTab").removeClass("active"); + // $("#optionsListManagerTab").removeClass("active"); $rootScope.isListManagerMenuSelected = false; console.log('listManager closed'); $rootScope.disableAnnotationtoolOnListManager = false; @@ -6547,7 +6635,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.CloseAnnotationTool(); $("#annotationButton").parent().addClass("disableMenuannotation"); $("#annotationToolBarOptions").addClass("disableMenuoption"); - $("#optionsListManagerTab").addClass("disableMenuoption"); + // $("#optionsListManagerTab").addClass("disableSubMenu"); $('#dvPrintPreview').css('display', 'block'); html2canvas($("#" + canvasDivId), { onrendered: function (canvas) { @@ -6920,7 +7008,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } $("#annotationToolBarOptions").removeClass("disableMenuoption"); - $("#optionsListManagerTab").removeClass("disableMenuoption"); + // $("#optionsListManagerTab").removeClass("disableSubMenu"); $('#fileMenuAnchor').parent().removeClass('disableFileMenu'); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js index 21ec004..21de0f0 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/LabExercController.js @@ -455,9 +455,12 @@ function ($scope, $rootScope, pages, log, $http, $timeout, DataService, $filter, } $scope.JsPanelclick = function (windowviewid) { + //reset option list manager and annotation + //call when module loaded + $rootScope.resetMenuOption(); // call from while open module in CB $("#labImagePanel_" + windowviewid).on('click', function (event) { - + $rootScope.resetMenuOptionOnClick(""); // var pnlName = event.currentTarget.id; $scope.$emit("cBEnableDisableMenuOption", ""); diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index c306e0d..b81ab54 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -870,10 +870,14 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } $scope.JsPanelclick = function (windowviewid) { + //reset option list manager and annotation + //call when module loaded + $rootScope.resetMenuOption(); // call from while open module in CB $("#AAImagePanel_" + windowviewid).on('click', function (event) { var pnlName=event.currentTarget.id; + $rootScope.resetMenuOptionOnClick(pnlName); $scope.$emit("cBEnableDisableMenuOption", pnlName); var titlt = $("#AAImagePanel_" + windowviewid).childNodes; -- libgit2 0.21.4