Showing
1 changed file
400-SOURCECODE/AIAHTML5.Web/app/controllers/DAController.js
... | ... | @@ -8532,78 +8532,87 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
8532 | 8532 | |
8533 | 8533 | |
8534 | 8534 | $scope.ShowSearch = function () { |
8535 | - var primaryLexiconIndex; | |
8536 | - for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) { | |
8537 | - if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) { | |
8538 | - primaryLexiconIndex = i; | |
8535 | + | |
8536 | + if (($rootScope.vocabTermDataArray != null || $rootScope.vocabTermDataArray != undefined) && ($rootScope.vocabTermDataArray.length > 0)) { | |
8537 | + var primaryLexiconIndex; | |
8538 | + for (var i = 0; i <= $rootScope.vocabTermDataArray.length - 1; i++) { | |
8539 | + if ($rootScope.vocabTermDataArray[i].language == $rootScope.lexiconLanguageArray[0].language) { | |
8540 | + primaryLexiconIndex = i; | |
8541 | + } | |
8542 | + } | |
8543 | + console.log('ShowSearch is called'); | |
8544 | + //this check is for log only because we are writing length so need to check if its not null or undefined | |
8545 | + | |
8546 | + if ($rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != null || $rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != undefined) { | |
8547 | + console.log('$scope.VocabTermTxt.length= ' + $rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt.length) | |
8539 | 8548 | } |
8540 | - } | |
8541 | - console.log('ShowSearch is called'); | |
8542 | - //this check is for log only because we are writing length so need to check if its not null or undefined | |
8543 | - if ($rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != null || $rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != undefined) | |
8544 | - console.log('$scope.VocabTermTxt.length= ' + $rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt.length) | |
8545 | 8549 | |
8546 | - $timeout(function () { | |
8547 | - | |
8548 | - if (($rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != null || $rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != undefined) && ($rootScope.vocabTermDataArray[0].vocabTermTxt.length > 0)) { | |
8549 | - //This is added as the $scope.VocabTermTxt can change while changing view also the li elements need to be removed | |
8550 | - //Remove the list and then Repopulate | |
8551 | - if ($('#searchListDiv').html() != "") | |
8552 | - $('#searchListDiv').empty() | |
8553 | - //Delay compile of ul li so that the remove of li is completed. | |
8554 | - $timeout(function () { | |
8555 | - console.log("INSIDE WATCH. LIST IS CREATED"); | |
8556 | - $scope.isSearchDataLoaded = true; | |
8550 | + $timeout(function () { | |
8557 | 8551 | |
8558 | - if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | |
8552 | + if (($rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != null || $rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != undefined) && ($rootScope.vocabTermDataArray[0].vocabTermTxt.length > 0)) { | |
8553 | + //This is added as the $scope.VocabTermTxt can change while changing view also the li elements need to be removed | |
8554 | + //Remove the list and then Repopulate | |
8555 | + if ($('#searchListDiv').html() != "") | |
8556 | + $('#searchListDiv').empty() | |
8557 | + //Delay compile of ul li so that the remove of li is completed. | |
8558 | + $timeout(function () { | |
8559 | + console.log("INSIDE WATCH. LIST IS CREATED"); | |
8560 | + $scope.isSearchDataLoaded = true; | |
8559 | 8561 | |
8560 | - if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { | |
8561 | - $rootScope.isLoading = false; | |
8562 | - $('#spinner').css('visibility', 'hidden'); | |
8563 | - } | |
8564 | - else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { | |
8565 | - $rootScope.isLoading = false; | |
8566 | - $('#spinner').css('visibility', 'hidden'); | |
8567 | - } | |
8568 | - else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) { | |
8569 | - $rootScope.isLoading = false; | |
8570 | - $('#spinner').css('visibility', 'hidden'); | |
8571 | - } | |
8572 | - else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) { | |
8573 | - $rootScope.isLoading = false; | |
8574 | - $('#spinner').css('visibility', 'hidden'); | |
8562 | + if (($scope.ColoredImageSRC != null || $scope.ColoredImageSRC != undefined)) { | |
8563 | + | |
8564 | + if ((($rootScope.viewOrientationId == '1') || ($rootScope.viewOrientationId == '4')) && ($scope.ColoredImageSRC.length == 9)) { | |
8565 | + $rootScope.isLoading = false; | |
8566 | + $('#spinner').css('visibility', 'hidden'); | |
8567 | + } | |
8568 | + else if ((($rootScope.viewOrientationId == '2') || ($rootScope.viewOrientationId == '3')) && ($scope.ColoredImageSRC.length == 5)) { | |
8569 | + $rootScope.isLoading = false; | |
8570 | + $('#spinner').css('visibility', 'hidden'); | |
8571 | + } | |
8572 | + else if (($rootScope.viewOrientationId == '5') && ($scope.ColoredImageSRC.length == 4)) { | |
8573 | + $rootScope.isLoading = false; | |
8574 | + $('#spinner').css('visibility', 'hidden'); | |
8575 | + } | |
8576 | + else if (($rootScope.viewOrientationId == '6') && ($scope.ColoredImageSRC.length == 1)) { | |
8577 | + $rootScope.isLoading = false; | |
8578 | + $('#spinner').css('visibility', 'hidden'); | |
8579 | + } | |
8575 | 8580 | } |
8581 | + | |
8582 | + }, 500); | |
8583 | + $scope.IsSearchVisible = true; | |
8584 | + console.log("s" + $rootScope.vocabTermDataArray[primaryLexiconIndex].language); | |
8585 | + $rootScope.a = primaryLexiconIndex; | |
8586 | + var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:60001;"><li ng-repeat="item in vocabTermDataArray[a].vocabTermTxt| filter:{ _TermText: searchFilter}">' + | |
8587 | + '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' + | |
8588 | + ' </li></ul>').appendTo('#searchListDiv') | |
8589 | + $compile($e2)($scope); | |
8590 | + document.getElementById("termlistfilter").style.display = "block"; | |
8591 | + $timeout(function () { | |
8592 | + $rootScope.searchListArray = []; | |
8593 | + $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { | |
8594 | + $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") }); | |
8595 | + }); | |
8596 | + }, 100); | |
8597 | + } | |
8598 | + else { | |
8599 | + $rootScope.loadSearchData(); | |
8600 | + if (($rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != null || $rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt != undefined) && ($rootScope.vocabTermDataArray[0].vocabTermTxt.length > 0)) { | |
8601 | + $scope.ShowSearch(); | |
8576 | 8602 | } |
8577 | 8603 | |
8578 | - }, 500); | |
8579 | - $scope.IsSearchVisible = true; | |
8580 | - console.log("s" + $rootScope.vocabTermDataArray[primaryLexiconIndex].language); | |
8581 | - $rootScope.a = primaryLexiconIndex; | |
8582 | - var $e2 = $('<ul id="termlistfilter" class="form-control dropdown-menu" style="height:90px;width:100%;overflow-y:scroll;position:absolute;display:none;z-index:60001;"><li ng-repeat="item in vocabTermDataArray[a].vocabTermTxt| filter:{ _TermText: searchFilter}">' + | |
8583 | - '<a id="{{item._ActualTermNumber}}" href="" onclick="selectTerm(event)">{{item._TermText}}</a>' + | |
8584 | - ' </li></ul>').appendTo('#searchListDiv') | |
8585 | - $compile($e2)($scope); | |
8586 | - document.getElementById("termlistfilter").style.display = "block"; | |
8587 | - $timeout(function () { | |
8588 | - $rootScope.searchListArray = []; | |
8589 | - $("#backdrop > #searchListDiv > #termlistfilter > li").each(function (key, value) { | |
8590 | - $rootScope.searchListArray.push({ "name": $(this).find("a").html(), "id": $(this).find("a").attr("id") }); | |
8591 | - }); | |
8592 | - }, 100); | |
8593 | - } | |
8594 | - else { | |
8595 | - $rootScope.loadSearchData(); | |
8596 | - if ($rootScope.vocabTermDataArray[primaryLexiconIndex].vocabTermTxt.length > 0) { | |
8597 | - $scope.ShowSearch(); | |
8598 | 8604 | } |
8599 | - } | |
8600 | - | |
8601 | 8605 | |
8602 | - }, 500); | |
8603 | 8606 | |
8607 | + }, 500); | |
8608 | + } | |
8609 | + else { | |
8610 | + | |
8611 | + $rootScope.loadSearchData(); | |
8612 | + $scope.ShowSearch(); | |
8613 | + | |
8614 | + } | |
8604 | 8615 | } |
8605 | - | |
8606 | - | |
8607 | 8616 | $scope.HideSearch = function () { |
8608 | 8617 | |
8609 | 8618 | $timeout(function () { |
... | ... | @@ -9251,7 +9260,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
9251 | 9260 | $scope.LayerChangeBasedOnKeyPressed = function (e) { |
9252 | 9261 | // Dissectible Anatomy > Should not display blank page if no layer is selected. |
9253 | 9262 | |
9254 | - | |
9263 | + | |
9255 | 9264 | if (e.keyCode == 13) { |
9256 | 9265 | |
9257 | 9266 | if ($("#txtlayerNumber").val() == '') { |
... | ... | @@ -9298,7 +9307,7 @@ AIA.controller("DAController", ["$scope", "$rootScope", "$compile", "$http", "$l |
9298 | 9307 | $scope.LayerValueChangeBasedOnKeyUp = function (e) { |
9299 | 9308 | |
9300 | 9309 | var keyUplayerNumber = parseInt($("#txtlayerNumber").val()); |
9301 | - | |
9310 | + | |
9302 | 9311 | if (isNaN(keyUplayerNumber)) |
9303 | 9312 | { |
9304 | 9313 | document.getElementById("txtlayerNumber").value = ""; | ... | ... |