Commit 912e60ffb341a40bc4c67e95ec350e3c36fe2619

Authored by unknown
1 parent de053475

List Manager Implemented

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
@@ -1178,7 +1178,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1178,7 +1178,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1178 $scope.AAPinTermData = response.data.PinTermData.TermData; 1178 $scope.AAPinTermData = response.data.PinTermData.TermData;
1179 $rootScope.isLoading = false; 1179 $rootScope.isLoading = false;
1180 $('#setting-spinner').css('visibility', 'hidden'); 1180 $('#setting-spinner').css('visibility', 'hidden');
1181 - 1181 +
1182 $scope.pinTermData = []; 1182 $scope.pinTermData = [];
1183 var primaryLexicon = $rootScope.lexiconLanguageArray[0].id; 1183 var primaryLexicon = $rootScope.lexiconLanguageArray[0].id;
1184 $scope.matchedLanguageTermData = new jinqJs() 1184 $scope.matchedLanguageTermData = new jinqJs()
@@ -1188,34 +1188,41 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1188,34 +1188,41 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1188 1188
1189 for (var i = 0; i < $scope.matchedLanguageTermData.length; i++) { 1189 for (var i = 0; i < $scope.matchedLanguageTermData.length; i++) {
1190 $scope.pinTermData.push({ "LanguageId": $scope.matchedLanguageTermData[i]._LanguageId, "TermNumber": $scope.matchedLanguageTermData[i]._TermNumber, "TermTxt": $scope.matchedLanguageTermData[i]._TermText }); 1190 $scope.pinTermData.push({ "LanguageId": $scope.matchedLanguageTermData[i]._LanguageId, "TermNumber": $scope.matchedLanguageTermData[i]._TermNumber, "TermTxt": $scope.matchedLanguageTermData[i]._TermText });
1191 - 1191 + // console.log($scope.pinTermData);
1192 } 1192 }
1193 $scope.$watch('$scope.pinTermData', function (newValue, oldValue, scope) { 1193 $scope.$watch('$scope.pinTermData', function (newValue, oldValue, scope) {
1194 if ($('#termlistfilter').html() != "") 1194 if ($('#termlistfilter').html() != "")
1195 - $('#termlistfilter').empty() 1195 + $('#termList').empty();
  1196 + $('#termlistfilter').empty()
1196 if ($scope.pinTermData.length > 0) { 1197 if ($scope.pinTermData.length > 0) {
1197 $timeout(function () { 1198 $timeout(function () {
1198 console.log('pinTermData= ' + $scope.pinTermData.length); 1199 console.log('pinTermData= ' + $scope.pinTermData.length);
1199 -  
1200 for (var j = 0; j < $scope.pinTermData.length; j++) { 1200 for (var j = 0; j < $scope.pinTermData.length; j++) {
1201 var $el = $('<li><a id= "' + $scope.pinTermData[j].TermNumber + '" href="" onclick="onSearchItemSelection(event)" >' + $scope.pinTermData[j].TermTxt + '</a></li>').appendTo('#termlistfilter') 1201 var $el = $('<li><a id= "' + $scope.pinTermData[j].TermNumber + '" href="" onclick="onSearchItemSelection(event)" >' + $scope.pinTermData[j].TermTxt + '</a></li>').appendTo('#termlistfilter')
1202 $compile($el)($scope); 1202 $compile($el)($scope);
1203 - 1203 + var $selectOptions = $('<option id= "' + $scope.pinTermData[j].TermNumber + '" onclick="onSearchItemSelection(event)" >' + $scope.pinTermData[j].TermTxt + '</option>').appendTo("#termList")
  1204 + $compile($selectOptions)($scope);
1204 } 1205 }
1205 - 1206 +
1206 }, 500); 1207 }, 500);
1207 } 1208 }
1208 }) 1209 })
1209 - 1210 +
1210 }, 1211 },
1211 function (error) { 1212 function (error) {
1212 // handle errors here 1213 // handle errors here
1213 console.log(' error: ' + error.statusText); 1214 console.log(' error: ' + error.statusText);
1214 } 1215 }
1215 ) 1216 )
1216 - 1217 +
1217 } 1218 }
1218 - 1219 + $scope.$on('listManagerEvent', function (event, data) {
  1220 + $("#viewName").empty();
  1221 + $("#viewName").append("<option>"+$rootScope.listArray[0].text+"</option>");
  1222 + $rootScope.isLoading = false;
  1223 + $('#spinner').css('visibility', 'hidden');
  1224 +
  1225 + });
1219 1226
1220 $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo) { 1227 $scope.GetAnnotationBasedOnActualTermNo = function (actualTermNo) {
1221 1228
@@ -1492,6 +1499,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -1492,6 +1499,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
1492 } 1499 }
1493 } 1500 }
1494 } 1501 }
  1502 +
1495 }]); 1503 }]);
1496 1504
1497 function showSelectedSystemPins(event) { 1505 function showSelectedSystemPins(event) {