diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
index d4a9c53..09e8887 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
@@ -667,7 +667,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
})
// $rootScope.languageArray = [];
$rootScope.loadSearchData = function () {
-
+ var primaryLexiconIndex;
var languageArray = [];
$rootScope.vocabTermDataArray = [];
var languageArray = $rootScope.lexiconLanguageArray;
@@ -719,14 +719,13 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
if ($rootScope.vocabTermDataArray.length == $rootScope.lexiconLanguageArray.length) {
$("#setting-spinner").css("display", "none");
- // $rootScope.isLoading = false;
- // $("#spinner").css("visibility", "hidden");
- // // $("#spinner").css("display", "none");
-
- //} else {
- // $rootScope.isLoading = true;
- // $("#spinner").css("visibility", "visible");
- // // $("#spinner").css("visibility", "block");
+
+ for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) {
+ if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) {
+ primaryLexiconIndex = i;
+ }
+ }
+ //alert(primaryLexiconIndex);
if ($rootScope.isListManagerMenuSelected) {
$scope.loadListManger();
}
@@ -748,55 +747,16 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
}
}
-
-
-
-
-
}
+
+ //console.log("s" + $rootScope.vocabTermDataArray);
//call watch on '$scope.VocabTermTxt and compile
and append to on first time load
- $scope.$watch('$rootScope.vocabTermDataArray[0].vocabTermTxt', function (newValue, oldValue, scope) {
-
- //This is added as the $scope.VocabTermTxt can change while changing view also the li elements need to be removed
- //Remove the list and then Repopulate
- if ($('#searchListDiv').html() != "")
- $('#searchListDiv').empty()
- //Delay compile of ul li so that the remove of li is completed.
- $timeout(function () {
- var $e2 = $('').appendTo('#searchListDiv')
- $compile($e2)($scope);
-
- $rootScope.isSearchInputClicked = true;
-
- console.log("INSIDE WATCH. LIST IS CREATED");
- $scope.isSearchDataLoaded = true;
-
- if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
-
- if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
- $rootScope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
- }
- else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
- $rootScope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
- }
- else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
- $rootScope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
- }
- else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
- $rootScope.isLoading = false;
- $('#spinner').css('visibility', 'hidden');
- }
- }
-
- }, 500);
+ //$scope.$watch('$rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt', function (newValue, oldValue, scope) {
+
+
- }, true);
+ //}, true);
}
@@ -1387,7 +1347,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
}
else {
- // debugger;
//below 4 bodyviews have only single body region
if (($rootScope.voId == '9') || ($rootScope.voId == '11') || ($rootScope.voId == '10') || ($rootScope.voId == '12')) {
var bodyRegion = SelectedLayerData.BodyRegion._BodyRegionId;
@@ -1397,7 +1356,6 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
}
else // it is for other body view which have multiple body regions and layer no > 0
{
- // debugger;
if (SelectedLayerData.BodyRegion.length > 0) {
for (var z = 0; z <= SelectedLayerData.BodyRegion.length; z++) {
var bodyRegion = SelectedLayerData.BodyRegion[z]._BodyRegionId;
@@ -8423,32 +8381,72 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
$scope.ShowSearch = function () {
+ var primaryLexiconIndex;
+ for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) {
+ if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) {
+ primaryLexiconIndex = i;
+ }
+ }
console.log('ShowSearch is called');
//this check is for log only because we are writing length so need to check if its not null or undefined
- if ($rootScope.vocabTermDataArray[0].vocabTermTxt != null || $rootScope.vocabTermDataArray[0].vocabTermTxt != undefined)
- console.log('$scope.VocabTermTxt.length= ' + $rootScope.vocabTermDataArray[0].vocabTermTxt.length)
+ if ($rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != null || $rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != undefined)
+ console.log('$scope.VocabTermTxt.length= ' + $rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt.length)
$timeout(function () {
- if (($rootScope.vocabTermDataArray[0].vocabTermTxt != null || $rootScope.vocabTermDataArray[0].vocabTermTxt != undefined) && ($rootScope.vocabTermDataArray[0].vocabTermTxt.length > 0)) {
+
+ if (($rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != null || $rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != undefined) && ($rootScope.vocabTermDataArray[0].vocabTermTxt.length > 0)) {
+ //This is added as the $scope.VocabTermTxt can change while changing view also the li elements need to be removed
+ //Remove the list and then Repopulate
+ if ($('#searchListDiv').html() != "")
+ $('#searchListDiv').empty()
+ //Delay compile of ul li so that the remove of li is completed.
+ $timeout(function () {
+ console.log("INSIDE WATCH. LIST IS CREATED");
+ $scope.isSearchDataLoaded = true;
+
+ if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) {
+
+ if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) {
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ }
+ else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) {
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ }
+ else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) {
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ }
+ else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) {
+ $rootScope.isLoading = false;
+ $('#spinner').css('visibility', 'hidden');
+ }
+ }
+ }, 500);
$scope.IsSearchVisible = true;
+ console.log("s" + $rootScope.vocabTermDataArray[primaryLexiconIndex].language);
+ $rootScope.a = primaryLexiconIndex;
+ var $e2 = $('').appendTo('#searchListDiv')
+ $compile($e2)($scope);
document.getElementById("termlistfilter").style.display = "block";
+ $timeout(function () {
+ $rootScope.searchListArray = [];
+ $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
+ $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") });
+ });
+ }, 100);
}
else {
$rootScope.loadSearchData();
- if ($rootScope.vocabTermDataArray[0].vocabTermTxt.length > 0) {
+ if ($rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt.length > 0) {
$scope.ShowSearch();
}
}
-
- if ($rootScope.isSearchInputClicked == true) {
- $rootScope.isSearchInputClicked = false;
- $rootScope.searchListArray = [];
- $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) {
- $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") });
- });
-
- }
+
}, 500);
@@ -8589,14 +8587,20 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l
});
$scope.loadListManger = function () {
-
+ var primaryLexiconIndex;
+ for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) {
+ if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) {
+ primaryLexiconIndex = i;
+ }
+ }
+ console.log($rootScope.vocabTermDataArray[primaryLexiconIndex].language);
$rootScope.isListManagerMenuSelected = true;
var vocabTermTxt = [];
if ($rootScope.TermNumberData != null || $rootScope.TermNumberData != undefined && $rootScope.TermNumberData.length > 0) {
angular.forEach($rootScope.TermNumberData.TermData.Term, function (value1, key1) {
- angular.forEach($rootScope.vocabTermDataArray[0].VocabTermData.VocabTerms.Term, function (value2, key2) {
+ angular.forEach($rootScope.vocabTermDataArray[primaryLexiconIndex].VocabTermData.VocabTerms.Term, function (value2, key2) {
if (value1._ActualTermNumber === value2._ActualTermNumber) {