Commit 753f7b9b4d796a29c8fdfe64da0fdff6c7d987c0

Authored by Birendra
1 parent 588a25dd

fixe more bug in DA for lexicon setting

400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... ... @@ -1307,8 +1307,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
1307 1307 else {
1308 1308 if ($('#termlistfilter_'+windowviewid+ ' option[selected="selected"]').attr("id")) {
1309 1309 if (e.keyCode == 13) {
1310   - onListManagerTermSelection($('#termlistfilter_'+windowviewid+ ' option[selected="selected"]').attr("id"),false);
1311   - $scope.IsSearchVisible=false;
  1310 + onListManagerTermSelection($('#termlistfilter_'+windowviewid+ ' option[selected="selected"]').attr("id"),false);
1312 1311 }
1313 1312 }
1314 1313 }
... ... @@ -1324,17 +1323,20 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
1324 1323 $('#searchlangaugeDiv').empty();
1325 1324 $('#searchlangaugeDiv').css("display","none");
1326 1325 var languageArray = $rootScope.lexiconLanguageArray;
  1326 +
  1327 + $("#btnDATermSearch_"+windowviewid).parent().css("margin-right", "10px");
1327 1328  
1328 1329 if(languageArray.length>1)
1329 1330 {
  1331 + $("#btnDATermSearch_"+windowviewid).parent().css("margin-right", "-10px");
1330 1332 $('#searchlangaugeDiv').css("display","block");
1331 1333 var option='';
1332 1334 for (var i = 0; i <= languageArray.length - 1; i++) {
1333 1335 option=option+'<option value="' + languageArray[i].id + '">' + languageArray[i].language + '</option>';
1334 1336 }
1335 1337 var $all = $('#searchlangaugeDiv').append(
1336   - '<div class="btn-group col-sm-3 col-xs-7 col-md-2" style="margin-left:-15px;margin-right:-12px">'+
1337   - '<select class="form-control" id="searchLanguageLm_'+windowviewid+'" ng-blur="HideSearch()" style="height:30px;padding:4px 12px">'+
  1338 + '<div class="btn-group col-sm-3 col-xs-7 col-md-2" style="margin-right:-10px">'+
  1339 + '<select class="form-control" id="searchLanguageLm_'+windowviewid+'" ng-blur="HideSearch()" onchange="changeSearchLanguage(event)" style="height:30px;padding:4px 12px">'+
1338 1340 option+
1339 1341 '</select>'+
1340 1342 '</div>'
... ... @@ -1343,6 +1345,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
1343 1345  
1344 1346 }
1345 1347  
  1348 + $scope.changeSearchText(windowviewid)
1346 1349 }
1347 1350  
1348 1351 $scope.CanvasDivScroll = function (windowviewid) {
... ... @@ -3007,7 +3010,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3007 3010 if ($scope.isLayerChange == true) {
3008 3011 $scope.isLayerChange = false;
3009 3012 }
3010   -
  3013 + $('#typedTermName_' + windowviewid).val('');
  3014 + $("#typedTermName_" + windowviewid).attr("name", '0');
3011 3015 //birendra
3012 3016 // for mac os Command key use for multi selection
3013 3017 if (evt.ctrlKey || evt.metaKey) {
... ... @@ -3016,7 +3020,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3016 3020 else
3017 3021 {
3018 3022 $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
3019   - $('#typedTermName_' + windowviewid).val('');
  3023 +
3020 3024 $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []);
3021 3025 $scope.SetwindowStoreData(windowviewid, 'AllTerms', []);
3022 3026 $scope.SetwindowStoreData(windowviewid,'previousHighlightList',[]);
... ... @@ -3505,6 +3509,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3505 3509 if ($scope.isLayerChange == true) {
3506 3510 $scope.isLayerChange = false;
3507 3511 }
  3512 + $('#typedTermName_' + windowviewid).val('');
  3513 + $("#typedTermName_" + windowviewid).attr("name", '0');
3508 3514 //birendra
3509 3515 // for mac os Command key use for multi selection
3510 3516 if (evt.ctrlKey || evt.metaKey) {
... ... @@ -3514,8 +3520,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
3514 3520 }
3515 3521 else
3516 3522 {
3517   - $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
3518   - $('#typedTermName_' + windowviewid).val('');
  3523 + $scope.SetwindowStoreData(windowviewid,'isListManagerSelected',false);
3519 3524 $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []);
3520 3525 $scope.SetwindowStoreData(windowviewid, 'AllTerms', []);
3521 3526 $scope.SetwindowStoreData(windowviewid,'previousHighlightList',[]);
... ... @@ -5009,6 +5014,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
5009 5014 $scope.SetwindowStoreData(windowviewid, 'fullTermlist', []);
5010 5015  
5011 5016 $('#typedTermName_' + windowviewid).val('');
  5017 + $("#typedTermName_" + windowviewid).attr("name", '0');
5012 5018  
5013 5019 if (($("#canvasPaintDA_"+windowviewid).css("display") == "block") && ($("#canvasDA_"+windowviewid).css("display") == "block")) {
5014 5020 if ($rootScope.isAnnotatiomToolBarPopupActive == false) {
... ... @@ -10318,6 +10324,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10318 10324  
10319 10325 $rootScope.CloseAnnotationTool();
10320 10326 $('#typedTermName_' + windowviewid).val('');
  10327 + $("#typedTermName_" + windowviewid).attr("name", '0');
10321 10328 }
10322 10329  
10323 10330 $scope.loadBodyViewChangedBySetting = function (windowviewid, isLexiconChange) {
... ... @@ -10329,9 +10336,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10329 10336 {
10330 10337 // remove first annotation text
10331 10338 $scope.SetwindowStoreData(windowviewid,'isHighlightBodyWithCBTermData',true);
10332   - $scope.removeAllAnnotationText(windowviewid);
10333   -
10334   - $scope.langSearchLoad(windowviewid);
  10339 + $scope.removeAllAnnotationText(windowviewid);
10335 10340 //load term data and also language data
10336 10341 $rootScope.daloadSearchData(windowviewid);
10337 10342 timeintval = $interval(function(){loadBodyViewBySetting(windowviewid)},5);
... ... @@ -10340,7 +10345,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10340 10345 var vocabTermDataArray = $scope.GetwindowStoreData(panid, 'vocabTermDataArray');
10341 10346 if (vocabTermDataArray!=null) {
10342 10347 var intval=$scope.GetwindowStoreData(panid,'intervalObject');
10343   - $scope.stopVocab(intval);
  10348 + $scope.stopVocab(intval);
  10349 + $scope.langSearchLoad(windowviewid);
10344 10350 //loading da for selected panel
10345 10351 $scope.CalculateImageCordinates(viewOrientationId, panid);
10346 10352  
... ... @@ -10652,6 +10658,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
10652 10658  
10653 10659 $rootScope.CloseAnnotationTool();
10654 10660 $('#typedTermName_' + windowviewid).val('');
  10661 + $("#typedTermName_" + windowviewid).attr("name", '0');
10655 10662  
10656 10663 }
10657 10664 //removed the event and using function
... ... @@ -11027,11 +11034,11 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11027 11034 var searchfilterdata = $filter('filter')(languageVocabData, searchvalue);
11028 11035 if(searchvalue.trim()!="")
11029 11036 {
11030   - $scope.AllSearchData = $filter('orderBy')(searchfilterdata, '_TermText.length');
  11037 + searchfilterdata = $filter('orderBy')(searchfilterdata, '_TermText.length');
11031 11038 }
11032 11039 else
11033 11040 {
11034   - $scope.AllSearchData = $filter('orderBy')(searchfilterdata, '_TermText');
  11041 + searchfilterdata = $filter('orderBy')(searchfilterdata, '_TermText');
11035 11042 }
11036 11043  
11037 11044 $scope.limitTofilterdata = $filter('limitTo')(searchfilterdata, 500);
... ... @@ -11409,14 +11416,19 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11409 11416 $rootScope.UnsaveCurriculum = true;
11410 11417 var currenttermidTxt=$("#" + selectedtermid).text();
11411 11418 $scope.SetwindowStoreData(windowviewid,'searchSelectedText',currenttermidTxt);
  11419 + $scope.IsSearchVisible=false;
11412 11420  
11413 11421 var actualTermNumber= selectedtermid.split('_')[0];
11414 11422 if (isTermListOptionClicked == true) {
11415 11423 $('#typedTermName_' + windowviewid).val('');
  11424 + $("#typedTermName_" + windowviewid).attr("name", '0');
11416 11425 }
11417 11426 else
11418 11427 {
11419 11428 $('#typedTermName_' + windowviewid).val(currenttermidTxt);
  11429 + $("#typedTermName_" + windowviewid).attr("name", actualTermNumber);
  11430 + $("#termlistfilter_" + windowviewid).empty();
  11431 + $("#termlistfilter_" + windowviewid).css("display", "none");
11420 11432 }
11421 11433 if ($scope.GetwindowStoreData(windowviewid,'isTransparencyActivated')) {
11422 11434 $scope.CloseTransparencyBox(false,windowviewid);
... ... @@ -11898,9 +11910,85 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
11898 11910  
11899 11911 var $all = $('#termlistfilter_'+windowviewid).appendTo('#searchListDiv_' + windowviewid);
11900 11912 $compile($all)($scope);
11901   -
  11913 +
  11914 + $("#typedTermName_" + windowviewid).attr("name", "0");
  11915 +
11902 11916 };
11903 11917  
  11918 +
  11919 + $scope.changeSearchLanguage = function (event) {
  11920 +
  11921 + var len= (event.currentTarget.id).split("_").length;
  11922 + var windowviewid = (event.currentTarget.id).split("_")[len-1];
  11923 +
  11924 + $scope.changeSearchText(windowviewid);
  11925 +
  11926 + }
  11927 +
  11928 + $scope.changeSearchText = function (windowviewid) {
  11929 +
  11930 + setTimeout(function () {
  11931 +
  11932 + // var searchvalue = $("#typedTermName_" + windowviewid).val();
  11933 + var term_num = $("#typedTermName_" + windowviewid).attr("name");
  11934 + if(term_num!=undefined && term_num!="0")
  11935 + {
  11936 + var langId = $("#searchLanguageLm_"+windowviewid+" option:selected").val();
  11937 + if(langId!=undefined)
  11938 + {
  11939 + var selectedLanguage = new jinqJs()
  11940 + .from( $rootScope.lexiconLanguageArray)
  11941 + .where('id == ' + langId)
  11942 + .select()[0];
  11943 +
  11944 + var lanName=selectedLanguage.language;
  11945 +
  11946 + }
  11947 + else
  11948 + {
  11949 + var lanName=$rootScope.lexiconLanguageArray[0].language;
  11950 + }
  11951 +
  11952 + var allVocabTermDataArray=$scope.GetwindowStoreData(windowviewid,'vocabTermDataArray');
  11953 +
  11954 + var FoundVovabTerm = new jinqJs()
  11955 + .from( allVocabTermDataArray)
  11956 + .where('language == ' + lanName)
  11957 + .select('vocabTermTxt')[0];
  11958 +
  11959 + var foundterm= FoundVovabTerm.vocabTermTxt;
  11960 +
  11961 + var selectedTerm = new jinqJs()
  11962 + .from( foundterm)
  11963 + .where('_ActualTermNumber == '+term_num)
  11964 + .select()[0];
  11965 +
  11966 +
  11967 + if(selectedTerm!=undefined)
  11968 + {
  11969 +
  11970 + $("#typedTermName_" + windowviewid).attr("name", selectedTerm._ActualTermNumber);
  11971 + $("#typedTermName_" + windowviewid).val(selectedTerm._TermText);
  11972 +
  11973 + }
  11974 + else
  11975 + {
  11976 + $("#typedTermName_" + windowviewid).attr("name", "0");
  11977 + $("#typedTermName_" + windowviewid).val('');
  11978 + }
  11979 +
  11980 + }
  11981 + else
  11982 + {
  11983 + $("#typedTermName_" + windowviewid).attr("name", "0");
  11984 + $("#typedTermName_" + windowviewid).val('');
  11985 + }
  11986 +
  11987 + },100)
  11988 +
  11989 +
  11990 + }
  11991 +
11904 11992 $scope.ApplySearch = function (event) {
11905 11993 var len= (event.currentTarget.id).split("_").length;
11906 11994 var windowviewid = (event.currentTarget.id).split("_")[len-1];
... ... @@ -12004,6 +12092,7 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
12004 12092 var langId = $("#selectLanguage_"+windowviewid+" option:selected").val();
12005 12093 if(langId!=undefined)
12006 12094 {
  12095 +
12007 12096 var selectedLanguage = new jinqJs()
12008 12097 .from( $rootScope.lexiconLanguageArray)
12009 12098 .where('id == ' + langId)
... ... @@ -12016,7 +12105,8 @@ AIA.controller(&quot;DAController&quot;, [&quot;$scope&quot;, &quot;$rootScope&quot;, &quot;$compile&quot;, &quot;$http&quot;, &quot;$l
12016 12105 {
12017 12106 var lanName=$rootScope.lexiconLanguageArray[0].language;
12018 12107 }
12019   -
  12108 +
  12109 + $("#searchLanguageLm_"+windowviewid).val(langId);
12020 12110 $scope.loadSearchList(windowviewid,lanName,totalstructure);
12021 12111  
12022 12112 },100)
... ... @@ -12363,6 +12453,13 @@ function changeLanguageList(event) {
12363 12453 scope.changeLanguageList(event);
12364 12454 });
12365 12455 }
  12456 +function changeSearchLanguage(event) {
  12457 + event.stopPropagation();
  12458 + var scope = angular.element(document.getElementsByClassName("daBodyView")).scope();
  12459 + scope.$apply(function () {
  12460 + scope.changeSearchLanguage(event);
  12461 + });
  12462 +}
12366 12463  
12367 12464 function LoadMore(event) {
12368 12465 event.stopPropagation();
... ...
400-SOURCECODE/AIAHTML5.Web/app/views/da/da-view.html
... ... @@ -243,19 +243,18 @@
243 243 </div>
244 244 </div>
245 245  
246   - </div>
247   - <div id="searchlangaugeDiv">
248   -
249   - </div>
250   -
251   - <div class="btn-group" style="vertical-align:top;">
  246 + </div>
  247 + <div class="btn-group" style="vertical-align:top; float:left;margin-right: -10px;">
252 248  
253 249 <button type="button" id="btnDATermSearch" style="padding: 5px 10px 4px 10px !important;border: none;" class="btn btn-success btn-sm" onclick="OnSearch(event)">
254 250 <!--<img src="~/../content/images/DA/go-to.png" style="height: 30px;width:50px">-->
255 251 <i class="fa fa-caret-down" style="font-size:20px;"></i>
256 252 </button>
257 253 </div>
258   - <div class="btn-group" style="vertical-align:top;">
  254 + <div id="searchlangaugeDiv">
  255 +
  256 + </div>
  257 + <div class="btn-group" style="vertical-align:top;margin-right: 10px;">
259 258 <!-- <h6 class="text-center text-primary txt-white f11 col-xs-12">Search</h6>-->
260 259 <button type="button" id="btnSearchList" class="btn btn-primary btn-sm col-xs-12" onclick="ApplySearch(event)" style="margin-right:2px;">
261 260 <!-- <i class="fa fa-search"></i>-->
... ... @@ -323,7 +322,7 @@
323 322 <div class="row paddingTopBtm10">
324 323 <div class="col-sm-12" style="top:3px">
325 324 <div class="form-group" id="languageDiv">
326   - <select class="form-control" id="selectLanguage" onchange="changeLanguageList(event)" style="width:95%;font-size:14px">
  325 + <select class="form-control" id="selectLanguage" onchange="changeLanguageList(event)" style="font-size:14px">
327 326 </select>
328 327 </div>
329 328 <div>
... ...
400-SOURCECODE/AIAHTML5.Web/index.aspx
... ... @@ -893,7 +893,7 @@
893 893  
894 894 </div>
895 895 <div class="form-group" id="langaugeDivLm">
896   - <select class="form-control" id="selectLanguageLm" onchange="changeLanguageLmList(event)" style="width:95%;font-size:14px">
  896 + <select class="form-control" id="selectLanguageLm" onchange="changeLanguageLmList(event)" style="font-size:14px">
897 897 </select>
898 898 </div>
899 899  
... ...