diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js index 07f6214..c3da49f 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js @@ -65,7 +65,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l 'fullTermlist':[], 'isHighlightBodyWithCBTermData':false, 'CurriculumTermData':[], - 'primaryLexiconInd':0, + 'primaryLexiconInd':[], 'TermAnnotationText':[], 'AllTerms':[], 'actualTermNumber':0, @@ -867,7 +867,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l timeintval = undefined; } }; - }, + } $scope.loadBodyView = function (windowviewid) { @@ -1590,14 +1590,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.daloadSearchData = function (windowviewid) { - $scope.SetwindowStoreData(windowviewid, 'primaryLexiconInd', 0); - + $scope.SetwindowStoreData(windowviewid, 'primaryLexiconInd', []); + var languageInd = []; var languageArray = []; $scope.SetwindowStoreData(windowviewid, 'vocabTermDataArray', null); var languageArray = $rootScope.lexiconLanguageArray; console.log('loadSearchDataForBodyView'); var currentBodyViewId = $scope.GetwindowStoreData(windowviewid, 'voId'); + $scope.vocabTempTermArray = []; for (var i = 0; i <= languageArray.length - 1; i++) { var searchWorker = new Worker('search-wp.js'); @@ -1621,15 +1622,20 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // store image for export $scope.LoadImageToExport(windowviewid); - console.log("$rootScope.TermNumberData = " + e.data.TermNumberData.TermData.Term.length); - - console.log("$scope.BodyViewIDs" + e.data.bodyViewID); - $scope.vocabTempTermArray = []; + // console.log("$rootScope.TermNumberData = " + e.data.TermNumberData.TermData.Term.length); + // console.log("$scope.BodyViewIDs" + e.data.bodyViewID); + $scope.vocabTempTermArray.push({ "language": e.data.language, "VocabTermData": e.data.VocabTermData, "vocabTermTxt": e.data.vocabTermTxt }); + + + if ($scope.vocabTempTermArray.length == $rootScope.lexiconLanguageArray.length) { + $("#setting-spinner").css("display", "none"); for (var i = 0; i <= $rootScope.lexiconLanguageArray.length - 1; i++) { + languageInd.push(i); + $scope.vocabTempTermArray[i].vocabTermTxt = new jinqJs() .from($scope.vocabTempTermArray[i].vocabTermTxt) .distinct('_TermText', '_ActualTermNumber') @@ -1637,22 +1643,15 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l .select('_ActualTermNumber', '_TermText', '_cdId'); } - if ($scope.vocabTempTermArray.length == $rootScope.lexiconLanguageArray.length) { - $("#setting-spinner").css("display", "none"); + $scope.SetwindowStoreData(windowviewid, 'primaryLexiconInd', languageInd); // add data vocabTermDataArray $scope.SetwindowStoreData(windowviewid, 'vocabTermDataArray', $scope.vocabTempTermArray); - for (var i = 0; i <= $scope.vocabTempTermArray.length - 1; i++) { - if ($scope.vocabTempTermArray[i].language == $rootScope.lexiconLanguageArray[0].language) { - // $scope.primaryLexiconInd = i; - $scope.SetwindowStoreData(windowviewid, 'primaryLexiconInd', i); - } - } if ($rootScope.isListManagerMenuSelected) { $scope.loadListManger(windowviewid); } - else if ($scope.GetwindowStoreData(windowviewid,'isSearchClicked')) { - $scope.ShowSearch(windowviewid,false); + if ($scope.GetwindowStoreData(windowviewid,'isSearchClicked')) { + $scope.FillSearchList(windowviewid); } // terminate search worker instances @@ -5551,14 +5550,20 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (annotation == undefined) { console.log("No text found"); - } else { + } + else + { $("#canvasDivDA_" + windowviewid).append(sppechBubbleHTML); - + var lengLen=$scope.MultiLanguageAnnationArray.length; for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { var annotation = $scope.MultiLanguageAnnationArray[i]; - $("#" + id).append("
" + annotation + "
"); + if(lengLen>1) + { + $("#" + id).append(""); + } + lengLen--; } if ($scope.longestAnnotation != null || $scope.longestAnnotation != undefined) { $("#"+id).css("min-width", "auto"); @@ -5569,19 +5574,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (isHighlightBodyWithCBTermData == true) { var bubbleid = document.getElementById(id); - var bordid = 'bord' + speechBubbleCounter+'_'+windowviewid; - var canvasDiv = document.getElementById("canvasDivDA_" + windowviewid); - var verticalScrollPosition = canvasDiv.scrollTop; - var horizontlScrollPosition = canvasDiv.scrollLeft; - $scope.angle1(x, y, bubbleid.offsetLeft, bubbleid.offsetTop, bordid); $('#bubble' + speechBubbleCounter+'_'+windowviewid).css({ 'display': 'none' }); } - - } } @@ -5603,13 +5601,20 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if (MultipleLanguage == undefined) { console.log("No text is found"); - } else { + } + else + { $('#canvasDivDA_' + windowviewid).append(sppechBubbleDotHTML); - + var lengLen=$scope.MultiLanguageAnnationArray.length; if ($scope.MultiLanguageAnnationArray.length > 0) { for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) { var MultipleLanguage = $scope.MultiLanguageAnnationArray[i]; $('#sppeachBubble_' + windowviewid + '-' + termNumber).append("" + MultipleLanguage + "
"); + if(lengLen>1) + { + $('#sppeachBubble_' + windowviewid + '-' + termNumber).append(""); + } + lengLen--; } } else { @@ -5667,18 +5672,30 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l { var sppechBubbleHTML_annotation = "" + MultipleLang_annotation_T1 + "
"); + if(annotation1Len>1) + { + $("#" + sub_id_annotation).append(""); + } + annotation1Len--; } - $("#" + sub_id_annotation).append(""); + $("#" + sub_id_annotation).append(""); for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; $("#" + sub_id_annotation).append("" + MultipleLang_annotation_T2 + "
"); + if(annotation2Len>1) + { + $("#" + sub_id_annotation).append(""); + } + annotation2Len--; } if ($scope.longest_annotationT1 != null || $scope.longest_annotationT1 != undefined) { $("#" + sub_id_annotation).css("min-width", "auto"); @@ -5691,18 +5708,29 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#canvasDivDA_' + windowviewid).find("div[id=" + pointClicked_annotation + "]").css("display", "block"); } } - else { + else + { if (Exists_annotation == 0) { $('#canvasDivDA_' + windowviewid).append(sppechBubbleHTML_annotation); for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; $("#" + sub_id_annotation).append("" + MultipleLang_annotation_T1 + "
"); + if(annotation1Len>1) + { + $("#" + sub_id_annotation).append(""); + } + annotation1Len--; } - $("#" + sub_id_annotation).append(""); + $("#" + sub_id_annotation).append(""); for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; $("#" + sub_id_annotation).append("" + MultipleLang_annotation_T2 + "
"); + if(annotation2Len>1) + { + $("#" + sub_id_annotation).append(""); + } + annotation2Len--; } if ($scope.longest_annotationT2 != null || $scope.longest_annotationT2 != undefined) { $("#" + sub_id_annotation).css("min-width", "auto"); @@ -5731,17 +5759,31 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l + ''; $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).css("height", "auto"); + var annotation1Len=$scope.annotationTextArrayT1.length; + var annotation2Len=$scope.annotationTextArrayT2.length; + if ($scope.longest_annotationT1.length > $scope.longest_annotationT2.length) { $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber + " p").remove(); $('#canvasDivDA_' + windowviewid).append(sppechBubbleDotHTML_annotation); for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("" + MultipleLang_annotation_T1 + "
"); + if(annotation1Len>1) + { + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append(""); + } + annotation1Len--; + } - $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append(""); + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append(""); for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("" + MultipleLang_annotation_T2 + "
"); + if(annotation2Len>1) + { + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append(""); + } + annotation2Len--; } if ($scope.longest_annotationT1 != null || $scope.longest_annotationT1 != undefined) { $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).css("min-width", "auto"); @@ -5749,17 +5791,28 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } } - else { + else + { $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber + " p").remove(); $('#canvasDivDA_' + windowviewid).append(sppechBubbleDotHTML_annotation); for (var l = 0; l <= $scope.annotationTextArrayT1.length - 1; l++) { var MultipleLang_annotation_T1 = $scope.annotationTextArrayT1[l]; $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("" + MultipleLang_annotation_T1 + "
"); + if(annotation1Len>1) + { + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append(""); + } + annotation1Len--; } - $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append(""); + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append(""); for (var k = 0; k <= $scope.annotationTextArrayT2.length - 1; k++) { var MultipleLang_annotation_T2 = $scope.annotationTextArrayT2[k]; $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append("" + MultipleLang_annotation_T2 + "
"); + if(annotation2Len>1) + { + $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).append(""); + } + annotation2Len--; } if ($scope.longest_annotationT2 != null || $scope.longest_annotationT2 != undefined) { $('#sppeachBubble_annotation_' + windowviewid + '-' + termNumber).css("min-width", "auto"); @@ -10005,14 +10058,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // update body system : 5/5/2020;birendra $scope.highlightBodySystemName(windowviewid); - $scope.loadSelectedBodyView(currentBodyViewId, windowviewid); - - //4. $scope.loadNavigatorForSelectedBodyView(currentBodyViewId, windowviewid); //5. change the search terms as per the selected bodyview - $rootScope.daloadSearchData(windowviewid); + + $scope.loadSelectedBodyViewChange(currentBodyViewId, windowviewid); $scope.GetBodySystemData(currentBodyViewId,windowviewid); //6. @@ -10046,13 +10097,10 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // update body system : 5/5/2020;birendra $scope.highlightBodySystemName(windowviewid); - $scope.loadSelectedBodyView(currentBodyViewId, windowviewid); - - //4. $scope.loadNavigatorForSelectedBodyView(currentBodyViewId, windowviewid); //5. change the search terms as per the selected bodyview - $rootScope.daloadSearchData(windowviewid); + $scope.loadSelectedBodyViewChange(currentBodyViewId, windowviewid); $scope.GetBodySystemData(currentBodyViewId,windowviewid); //6. @@ -10084,8 +10132,68 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#typedTermName_' + windowviewid).val(''); } + $scope.loadBodyViewChangedBySetting = function (windowviewid, isLexiconChange) { + var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); + + if(isLexiconChange) + { + //load term data and also language data + $rootScope.daloadSearchData(windowviewid); + //call time interval function until load Illustration data + var timeintval = null; + timeintval = $interval(function () { + var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray'); + if (vocabTermDataArray!=null) { + $scope.stopVocab(); + $scope.CalculateImageCordinates(viewOrientationId, windowviewid); + } + else + { + console.log("waiting for search term Data"); + } + }, 100); + + $scope.stopVocab = function () { + if (angular.isDefined(timeintval)) { + $interval.cancel(timeintval); + timeintval = undefined; + } + }; + } + else + { + $scope.CalculateImageCordinates(viewOrientationId, windowviewid); + } + + } + + $scope.loadSelectedBodyViewChange = function (currentBodyViewId,windowviewid) { + $rootScope.daloadSearchData(windowviewid); + //call time interval function until load Illustration data + var timeintval = null; + timeintval = $interval(function () { + var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray'); + if (vocabTermDataArray!=null) { + $scope.stopVocab(); + $scope.loadSelectedBodyView(currentBodyViewId,windowviewid); + } + else + { + console.log("waiting for search term Data"); + } + }, 100); + + $scope.stopVocab = function () { + if (angular.isDefined(timeintval)) { + $interval.cancel(timeintval); + timeintval = undefined; + } + }; + } + + $scope.loadSelectedBodyView = function (currentBodyViewId, windowviewid) { - var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList'); + //remove transaprency scale if ($('#transparencyScale_' + windowviewid) != null) { @@ -10128,58 +10236,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l { $scope.SetwindowStoreData(windowviewid,'layerNumber',0); } + var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); + $('#txtLayerNumberDA_' + windowviewid).val( $scope.GetwindowStoreData(windowviewid,'layerNumber')); - //load json for annotations - - var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json'; - DataService.getAnotherJson(termJsonPath) - .then( - function (result) { - var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); - $scope.SetwindowStoreData(windowviewid,'TermNumberData',result); - var isViewChange=$scope.GetwindowStoreData(windowviewid,'isViewChange'); - var isGenderChnage=$scope.GetwindowStoreData(windowviewid,'isGenderChnage'); - var isListManagerSelected=$scope.GetwindowStoreData(windowviewid,'isListManagerSelected'); - var isListManagerAlreadySelected=$scope.GetwindowStoreData(windowviewid,'isListManagerAlreadySelected'); - //if user seelcted any term and serached before gender cnage then itshould be highlighted in chnaged gender - - if (((isListManagerSelected == true) || isListManagerAlreadySelected == true || - ($scope.GetwindowStoreData(windowviewid,'isHighLight') == true && previousHighlightList != null - && previousHighlightList.length > 0)) - && ((isGenderChnage == true) || isViewChange == true)) { - $scope.setLayerNumberAndHighlightByTermList(windowviewid); - } - else if (previousHighlightList != null && previousHighlightList.length > 0 && - (isGenderChnage == true || isViewChange == true)) - { - $scope.SetwindowStoreData(windowviewid,'AllTerms',[]); - $scope.SetwindowStoreData(windowviewid,'isHighLight',true); - var TermNData=$scope.GetwindowStoreData(windowviewid,'TermNumberData'); - if (TermNData != undefined) { - var actualTermNumber=$scope.GetwindowStoreData(windowviewid,'actualTermNumber'); - $scope.TermList = $scope.getTermNumberList(actualTermNumber,windowviewid); - if ($scope.TermList != null && $scope.TermList.length > 0) { - $scope.setLayerNumberAndHighlightByTermList(windowviewid); - } - else { - //actual term number is not found in thsi view menas previously selected body part does not exist in this view - $scope.CalculateImageCordinates(viewOrientationId, windowviewid) - } - } - - } - else { - $scope.CalculateImageCordinates(viewOrientationId, windowviewid); - $('#txtLayerNumberDA_' + windowviewid).val( $scope.GetwindowStoreData(windowviewid,'layerNumber')) - - } + $scope.CalculateImageCordinates(viewOrientationId, windowviewid); - }, - function (error) { - // handle errors here - console.log(' $rootScope.TermNumberData= ' + error.statusText); - } - ) }, function (error) { @@ -10189,6 +10250,111 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l ); } + // $scope.loadSelectedBodyView = function (currentBodyViewId, windowviewid) { + // var previousHighlightList=$scope.GetwindowStoreData(windowviewid,'previousHighlightList'); + // //remove transaprency scale + // if ($('#transparencyScale_' + windowviewid) != null) { + + // $('#transparencyScale_' + windowviewid).css('visibility', 'hidden'); + // } + + // $scope.SetwindowStoreData(windowviewid,'voId',currentBodyViewId); + + // var layerJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_layer_' + currentBodyViewId + '.json'; + + // DataService.getJson(layerJsonPath) + // .then( + // function (result) { + + // $scope.SetwindowStoreData(windowviewid,'BodyLayerData',result); + + // //set max for LayerNumber input + // var totalLayer = result.Layers.DataLayer.length-1; + + // $scope.SetwindowStoreData(windowviewid,'totalLayers',totalLayer); + + // $('#txtLayerNumberDA_' + windowviewid).attr('max', totalLayer); + + // console.log('inside DataService.getJson. document.getElementById layerChangeSlider value : ' + document.getElementById('layerChangeSlider') + 'set value: ' + totalLayer); + + // $("#layerChangeSliderDA_" + windowviewid).slider("option", "max", totalLayer); + + // // CB part to load same layer while change gender/bodyview + + // if($rootScope.isCallFromOtherModule) + // { + // var cLayer= $scope.GetwindowStoreData(windowviewid,'layerNumber'); + + // if(cLayer>totalLayer) + // { + // $scope.SetwindowStoreData(windowviewid,'layerNumber',totalLayer); + // } + // } + // else + // { + // $scope.SetwindowStoreData(windowviewid,'layerNumber',0); + // } + + // //load json for annotations + + // var termJsonPath = '~/../content/data/json/da/body-views/' + currentBodyViewId + '/da_dat_tm_sg_' + currentBodyViewId + '.json'; + // DataService.getAnotherJson(termJsonPath) + // .then( + // function (result) { + // var viewOrientationId=$scope.GetwindowStoreData(windowviewid,'viewOrientationId'); + // $scope.SetwindowStoreData(windowviewid,'TermNumberData',result); + // var isViewChange=$scope.GetwindowStoreData(windowviewid,'isViewChange'); + // var isGenderChnage=$scope.GetwindowStoreData(windowviewid,'isGenderChnage'); + // var isListManagerSelected=$scope.GetwindowStoreData(windowviewid,'isListManagerSelected'); + // var isListManagerAlreadySelected=$scope.GetwindowStoreData(windowviewid,'isListManagerAlreadySelected'); + // //if user seelcted any term and serached before gender cnage then itshould be highlighted in chnaged gender + + // if (((isListManagerSelected == true) || isListManagerAlreadySelected == true || + // ($scope.GetwindowStoreData(windowviewid,'isHighLight') == true && previousHighlightList != null + // && previousHighlightList.length > 0)) + // && ((isGenderChnage == true) || isViewChange == true)) { + // $scope.setLayerNumberAndHighlightByTermList(windowviewid); + // } + // else if (previousHighlightList != null && previousHighlightList.length > 0 && + // (isGenderChnage == true || isViewChange == true)) + // { + // $scope.SetwindowStoreData(windowviewid,'AllTerms',[]); + // $scope.SetwindowStoreData(windowviewid,'isHighLight',true); + // var TermNData=$scope.GetwindowStoreData(windowviewid,'TermNumberData'); + // if (TermNData != undefined) { + // var actualTermNumber=$scope.GetwindowStoreData(windowviewid,'actualTermNumber'); + // $scope.TermList = $scope.getTermNumberList(actualTermNumber,windowviewid); + // if ($scope.TermList != null && $scope.TermList.length > 0) { + // $scope.setLayerNumberAndHighlightByTermList(windowviewid); + // } + // else { + // //actual term number is not found in thsi view menas previously selected body part does not exist in this view + // $scope.CalculateImageCordinates(viewOrientationId, windowviewid) + // } + // } + + // } + // else { + // $scope.CalculateImageCordinates(viewOrientationId, windowviewid); + // $('#txtLayerNumberDA_' + windowviewid).val( $scope.GetwindowStoreData(windowviewid,'layerNumber')) + + // } + + // }, + // function (error) { + // // handle errors here + // console.log(' $rootScope.TermNumberData= ' + error.statusText); + // } + // ) + // }, + + // function (error) { + // // handle errors here + // console.log(' $rootScope.BodyLayerData= ' + error.statusText); + // } + // ); + // } + $scope.OnViewChange = function (event) { var parentid=event.target.parentElement.id; var len= (parentid).split("_").length; @@ -10296,14 +10462,11 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // update body system : 5/5/2020;birendra $scope.highlightBodySystemName(windowviewid); - //2. Load selected body view - $scope.loadSelectedBodyView(bodyVid,windowviewid); - //3. load corresponding navigator man $scope.loadNavigatorForSelectedBodyView(bodyVid,windowviewid); //4. change the search terms as per the selected bodyview - $rootScope.daloadSearchData(windowviewid); + $scope.loadSelectedBodyViewChange(bodyVid, windowviewid); $scope.GetBodySystemData(bodyVid,windowviewid); @@ -10328,14 +10491,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l // update body system : 5/5/2020;birendra $scope.highlightBodySystemName(windowviewid); - - $scope.loadSelectedBodyView(bodyVid, windowviewid); - + //3. load corresponding navigator man $scope.loadNavigatorForSelectedBodyView(bodyVid, windowviewid); - //4. change the search terms as per the selected bodyview - $rootScope.daloadSearchData(windowviewid); + $scope.loadSelectedBodyViewChange(bodyVid, windowviewid); + + $scope.GetBodySystemData(bodyVid,windowviewid); }; @@ -10372,7 +10534,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } //Reload DA controller Body View after setting Change - $rootScope.reloadDABodyViewEvent = function (bodyViewId, windowviewid) { + $rootScope.reloadDABodyViewEvent = function (bodyViewId,isLexiconChange, windowviewid) { //console.log('reloadDABodyViewEvent'); $scope.SetwindowStoreData(windowviewid,'isGlobalSettingChanged',true); if ($rootScope.isSettingEventAlredayDispachted == true) { @@ -10380,12 +10542,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $rootScope.isSettingEventAlredayDispachted = false; // define at home controller $scope.SetwindowStoreData(windowviewid,'layerNumber',parseInt($('#txtLayerNumberDA_' + windowviewid).val())); var currentLayerNumber=$scope.GetwindowStoreData(windowviewid,'currentLayerNumber'); - if ($scope.GetwindowStoreData(windowviewid,'isTransparencyActivated') && currentLayerNumber == 0) { + if ($scope.GetwindowStoreData(windowviewid,'isTransparencyActivated')) { $scope.SetwindowStoreData(windowviewid,'layerNumber',currentLayerNumber) ; - $scope.loadSelectedBodyView(bodyViewId, windowviewid); + $scope.loadBodyViewChangedBySetting(windowviewid,isLexiconChange); } - else if ($scope.GetwindowStoreData(windowviewid,'layerNumber') == 0) { - $scope.loadSelectedBodyView(bodyViewId, windowviewid); + else + { + $scope.loadBodyViewChangedBySetting(windowviewid,isLexiconChange); } $scope.loadNavigatorForSelectedBodyView(bodyViewId, windowviewid); @@ -10707,12 +10870,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $scope.ShowSearch = function (windowviewid, isbuttionclick) { - $scope.SetwindowStoreData(windowviewid,'isSearchClicked',true); console.log('ShowSearch is called'); // clear time stamp on text box click $scope.SetwindowStoreData(windowviewid, 'SearchTimeStampValue', 0); - var primaryLexiconIndx = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd'); + // get first language term text + var primaryLexiconIndx = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd')[0]; var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray'); //this check is for log only because we are writing length so need to check if its not null or undefined @@ -10859,18 +11022,12 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.loadListManger = function (windowviewid) { - var primaryLexiconIndex = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd'); + var primaryLexiconIndex = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd')[0]; var vocabTermDataArray=$scope.GetwindowStoreData(windowviewid,'vocabTermDataArray'); if (vocabTermDataArray != null && vocabTermDataArray != undefined && vocabTermDataArray.length > 0) { - - for (var i = 0; i <= vocabTermDataArray.length - 1; i++) { - if (vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) { - primaryLexiconIndex = i; - } - } - console.log(vocabTermDataArray[primaryLexiconIndex].language); + $('#termList').empty(); $rootScope.isListManagerMenuSelected = true; var vocabTermTxt = []; @@ -11494,8 +11651,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l } $scope.showFilteredTerms = function (windowviewid) { - - var lexiconInd = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd'); + // get first language term text + var lexiconInd = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd')[0]; var vocabTermDataArray = $scope.GetwindowStoreData(windowviewid, 'vocabTermDataArray')[lexiconInd].vocabTermTxt; @@ -11588,7 +11745,9 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l if ($('#searchTermListUl_' + windowviewid).html() != "") { $('#searchTermListUl_' + windowviewid).empty(); } - var primaryLexiconIndex = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd'); + $scope.SetwindowStoreData(windowviewid,'isSearchClicked',true); + + var primaryLexiconIndex = $scope.GetwindowStoreData(windowviewid, 'primaryLexiconInd')[0]; var vocabTermDataArray=$scope.GetwindowStoreData(windowviewid,'vocabTermDataArray'); var searchvalue = $("#typedTermName_" + windowviewid).val(); @@ -11631,6 +11790,8 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l $('#searchTermListUl_' + windowviewid).empty(); } + $scope.SetwindowStoreData(windowviewid,'isSearchClicked',false); + } //Created method by Sandeep for Save JSPanel Activity on the CB module diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js index 7bea324..12ef705 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js @@ -30,6 +30,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.CommonData; $rootScope.shapeType; $rootScope.canvasLayerNameCollection=[]; + $rootScope.islaxicanlanguageChange=false; $rootScope.globalSetting = { ethnicity: 'W', modesty: 'Y', @@ -2081,6 +2082,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $("#lexiconLangDropdown :selected").remove(); $('#secondLax').append(''); $rootScope.lexiconLanguageArray.push({ id: $rootScope.selectedId, language: $rootScope.selectedText }); + $rootScope.islaxicanlanguageChange=true; } }); @@ -2102,6 +2104,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.lexiconLanguageArray.push({ id: $(this).attr("val"), language: this.value }); }); $rootScope.lexiconLanguageArray.unshift({ id: $("#primarylaxican").attr("name"), language: $("#primarylaxican").val() }); + $rootScope.islaxicanlanguageChange=true; } }); @@ -2116,6 +2119,8 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $('#primarylaxican').attr("name", primarylaxiid); $rootScope.lexiconLanguageArray[0].id = primarylaxiid; $rootScope.lexiconLanguageArray[0].language = primarylaxicantext; + + $rootScope.islaxicanlanguageChange=true; } }); } @@ -8062,8 +8067,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data $rootScope.setEthncitySettings($rootScope.globalSetting.ethnicity); $rootScope.setModestySettings($rootScope.globalSetting.modesty); - - + $rootScope.islaxicanlanguageChange=false; if ($rootScope.isApplyBtnClicked == false) { $rootScope.deSelectLanguageOptions(); @@ -8324,18 +8328,19 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data } - if (isReloadingViewRequired == true) { - $rootScope.reloadChildController(); - } + if (isReloadingViewRequired == true || $rootScope.islaxicanlanguageChange) { + $rootScope.reloadChildController($rootScope.islaxicanlanguageChange); + } $rootScope.lexiconRemovedLanguage = []; $("#secondLax option").each(function () { $rootScope.lexiconRemovedLanguage.push({ "id": $(this).attr("val"), "language": $(this).val() }); }); - }; + $rootScope.islaxicanlanguageChange=false; + }; - $rootScope.reloadChildController = function () { + $rootScope.reloadChildController = function (isLexiconChange) { // change DA setting for single/multiple panel var modulePanel = $("#HomeContainerDiv").find("div[id*='ImagePanel']"); if (modulePanel != undefined && modulePanel.length>0) { @@ -8347,7 +8352,7 @@ function ($rootScope, $scope, Modules, $log, $location, $compile, $timeout, Data var MultiWinId = (paneld).split("_")[len - 1]; $rootScope.isSettingEventAlredayDispachted = true; var currentOpenViewId=$rootScope.GetDAwindowData(MultiWinId,"voId"); - $rootScope.reloadDABodyViewEvent(currentOpenViewId,MultiWinId); + $rootScope.reloadDABodyViewEvent(currentOpenViewId,isLexiconChange,MultiWinId); } } }