Commit 28b47a6dc86c438e675af24c6475e812c2b9e1c4
1 parent
68dc29b3
AIA Bug
Showing
3 changed files
with
60 additions
and
47 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
@@ -13,7 +13,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -13,7 +13,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
13 | $scope.idSelected; | 13 | $scope.idSelected; |
14 | $scope.srollListView; | 14 | $scope.srollListView; |
15 | $scope.query = { | 15 | $scope.query = { |
16 | - selectedbodyregion: '', | 16 | + SearchText: '', |
17 | + SearchTextByAlphabet: '', | ||
17 | }; | 18 | }; |
18 | 19 | ||
19 | $scope.setActiveTab = function (tabToSet) { | 20 | $scope.setActiveTab = function (tabToSet) { |
@@ -70,25 +71,36 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -70,25 +71,36 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
70 | 71 | ||
71 | $scope.reRunSearchOnLoad = function () { | 72 | $scope.reRunSearchOnLoad = function () { |
72 | 73 | ||
73 | - var curBodyRegion = $rootScope.getLocalStorageValue("AIImageId"); | ||
74 | - if (typeof (curBodyRegion) !== "undefined" && curBodyRegion !== null && curBodyRegion !== '') { | ||
75 | - $scope.query.selectedbodyregion = curBodyRegion; | 74 | + var searchByText = $rootScope.getLocalStorageValue("SearchText"); |
75 | + var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); | ||
76 | + | ||
77 | + if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { | ||
78 | + $scope.query.SearchText = searchByText; | ||
79 | + } | ||
80 | + else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') | ||
81 | + { | ||
82 | + $scope.query.SearchTextByAlphabet = searchTextByAlphabet; | ||
76 | } | 83 | } |
77 | else { | 84 | else { |
78 | - $scope.query.selectedbodyregion = ""; | 85 | + $scope.query.SearchTextByAlphabet = ""; |
79 | } | 86 | } |
80 | 87 | ||
81 | - if ($scope.query.selectedbodyregion == "") { | 88 | + if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") { |
89 | + | ||
82 | $scope.loadAllAI(); | 90 | $scope.loadAllAI(); |
83 | } | 91 | } |
92 | + else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") | ||
93 | + { | ||
94 | + $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet); | ||
95 | + } | ||
84 | else { | 96 | else { |
85 | - $scope.ApplySearch($scope.SearchText); | 97 | + $scope.ApplySearch($scope.query); |
86 | } | 98 | } |
87 | 99 | ||
88 | } | 100 | } |
89 | 101 | ||
90 | $scope.LoadAIJsonData = function () { | 102 | $scope.LoadAIJsonData = function () { |
91 | - | 103 | + $('ul li a').removeAttr("style"); |
92 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | 104 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
93 | promise.then( | 105 | promise.then( |
94 | function (result) { | 106 | function (result) { |
@@ -110,6 +122,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -110,6 +122,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
110 | 122 | ||
111 | $scope.loadAllAI = function () { | 123 | $scope.loadAllAI = function () { |
112 | $rootScope.isLoading = true; | 124 | $rootScope.isLoading = true; |
125 | + localStorage.setItem("SearchText", ''); | ||
126 | + localStorage.setItem("SearchByAlphabet", ''); | ||
127 | + $('ul li a').removeAttr("style"); | ||
113 | $('#aiSpinner').css('visibility', 'visible'); | 128 | $('#aiSpinner').css('visibility', 'visible'); |
114 | $('#aiSpinner').css('zIndex', '20000'); | 129 | $('#aiSpinner').css('zIndex', '20000'); |
115 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | 130 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
@@ -197,13 +212,14 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -197,13 +212,14 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
197 | }; | 212 | }; |
198 | 213 | ||
199 | $scope.Reset = function (query) { | 214 | $scope.Reset = function (query) { |
200 | - | ||
201 | - query.selectedbodyregion = ""; | 215 | + $('ul li a').removeAttr("style"); |
216 | + query.SearchText = ""; | ||
202 | 217 | ||
203 | 218 | ||
204 | 219 | ||
205 | //set localstorage values | 220 | //set localstorage values |
206 | - localStorage.setItem("AIImageId", ''); | 221 | + localStorage.setItem("SearchText", ''); |
222 | + localStorage.setItem("SearchByAlphabet", ''); | ||
207 | localStorage.setItem("AIListViewScroll", ''); | 223 | localStorage.setItem("AIListViewScroll", ''); |
208 | 224 | ||
209 | if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } | 225 | if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } |
@@ -216,17 +232,16 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -216,17 +232,16 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
216 | while ($scope.searchAIListViewData.length) { | 232 | while ($scope.searchAIListViewData.length) { |
217 | $scope.searchAIListViewData.pop(); | 233 | $scope.searchAIListViewData.pop(); |
218 | } | 234 | } |
219 | - | ||
220 | $scope.loadAllAI(); | 235 | $scope.loadAllAI(); |
221 | - | ||
222 | } | 236 | } |
223 | 237 | ||
224 | - $scope.ApplySearch = function (SearchText) { | ||
225 | - var currentSearchtext = $rootScope.getLocalStorageValue("AIImageId"); | ||
226 | - localStorage.setItem("AIImageId", ''); | 238 | + $scope.ApplySearch = function (query) { |
239 | + $('ul li a').removeAttr("style"); | ||
240 | + var currentSearchtext = $rootScope.getLocalStorageValue("SearchText"); | ||
241 | + localStorage.setItem("SearchText", ''); | ||
227 | if (currentSearchtext == "undefined" || (currentSearchtext == null || currentSearchtext == "")) | 242 | if (currentSearchtext == "undefined" || (currentSearchtext == null || currentSearchtext == "")) |
228 | { | 243 | { |
229 | - if (SearchText == "undefined" || (SearchText == null || SearchText == "")) | 244 | + if (query.SearchText == "undefined" || (query.SearchText == null || query.SearchText == "")) |
230 | { | 245 | { |
231 | $rootScope.errorMessage = AIAConstants.PLEASE_ENTER_SEARCH_TEXT; | 246 | $rootScope.errorMessage = AIAConstants.PLEASE_ENTER_SEARCH_TEXT; |
232 | $("#messageModal").modal('show'); | 247 | $("#messageModal").modal('show'); |
@@ -248,13 +263,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -248,13 +263,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
248 | 263 | ||
249 | 264 | ||
250 | 265 | ||
251 | - if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | 266 | + if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) { |
252 | 267 | ||
253 | - localStorage.setItem("AIImageId", SearchText); | 268 | + localStorage.setItem("SearchText", query.SearchText); |
254 | 269 | ||
255 | } | 270 | } |
256 | else { | 271 | else { |
257 | - localStorage.setItem("AIImageId", ''); | 272 | + localStorage.setItem("SearchText", ''); |
258 | 273 | ||
259 | } | 274 | } |
260 | 275 | ||
@@ -274,7 +289,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -274,7 +289,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
274 | 289 | ||
275 | var selectimg = true; | 290 | var selectimg = true; |
276 | //var count = 0; | 291 | //var count = 0; |
277 | - if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | 292 | + if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) { |
293 | + var SearchText = query.SearchText | ||
278 | var posbodyregion = value._Title.toLowerCase().indexOf(SearchText.toLowerCase()); | 294 | var posbodyregion = value._Title.toLowerCase().indexOf(SearchText.toLowerCase()); |
279 | if (posbodyregion > -1) { | 295 | if (posbodyregion > -1) { |
280 | selectimg = true; | 296 | selectimg = true; |
@@ -339,30 +355,27 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -339,30 +355,27 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
339 | 355 | ||
340 | 356 | ||
341 | 357 | ||
342 | - $scope.ApplySearchByAlphabet = function (SearchText) { | 358 | + $scope.ApplySearchByAlphabet = function (SearchTextByAlphabet) { |
359 | + | ||
360 | + $rootScope.SearchTextByAlphabet = SearchTextByAlphabet | ||
343 | $rootScope.isLoading = true; | 361 | $rootScope.isLoading = true; |
344 | $('ul li a').removeAttr("style"); | 362 | $('ul li a').removeAttr("style"); |
345 | $('#spinner').css('visibility', 'visible'); | 363 | $('#spinner').css('visibility', 'visible'); |
346 | - $('#' + SearchText).css({"color": "white", "background-color" : "#1B92D0"}); | 364 | + $('#' + $rootScope.SearchTextByAlphabet ).css({ "color": "white", "background-color": "#1B92D0" }); |
365 | + | ||
366 | + //color: #0095da; | ||
367 | + //background-color: #ffffff; | ||
347 | 368 | ||
348 | $scope.filterstring = true; | 369 | $scope.filterstring = true; |
349 | 370 | ||
350 | while ($scope.searchAIListViewData.length) { | 371 | while ($scope.searchAIListViewData.length) { |
351 | $scope.searchAIListViewData.pop(); | 372 | $scope.searchAIListViewData.pop(); |
352 | } | 373 | } |
353 | - | ||
354 | - | ||
355 | - | ||
356 | - | ||
357 | - | ||
358 | - if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | ||
359 | - | ||
360 | - localStorage.setItem("AIImageId", SearchText); | ||
361 | - | 374 | + if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { |
375 | + localStorage.setItem("SearchByAlphabet", SearchTextByAlphabet); | ||
362 | } | 376 | } |
363 | else { | 377 | else { |
364 | - localStorage.setItem("AIImageId", ''); | ||
365 | - | 378 | + localStorage.setItem("SearchByAlphabet", ''); |
366 | } | 379 | } |
367 | 380 | ||
368 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | 381 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
@@ -381,22 +394,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -381,22 +394,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
381 | 394 | ||
382 | var selectimg = true; | 395 | var selectimg = true; |
383 | //var count = 0; | 396 | //var count = 0; |
384 | - if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | ||
385 | - | 397 | + if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { |
386 | var firstChar = value._Title[0]; | 398 | var firstChar = value._Title[0]; |
387 | - | ||
388 | - if (firstChar == SearchText) { | ||
389 | - selectimg = true; | ||
390 | - //count = count + 1; | ||
391 | - | 399 | + if (firstChar == SearchTextByAlphabet) { |
400 | + selectimg = true; | ||
392 | } | 401 | } |
393 | else { | 402 | else { |
394 | selectimg = false; | 403 | selectimg = false; |
395 | - //count = count - 1; | ||
396 | } | 404 | } |
397 | - | ||
398 | } | 405 | } |
399 | - | ||
400 | if (selectimg === true) { | 406 | if (selectimg === true) { |
401 | $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage; | 407 | $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage; |
402 | 408 | ||
@@ -440,7 +446,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | @@ -440,7 +446,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout | ||
440 | 446 | ||
441 | }, | 447 | }, |
442 | function (error) { | 448 | function (error) { |
443 | - // handle errors here | ||
444 | console.log(' $scope.IllustrationData = ' + error.statusText); | 449 | console.log(' $scope.IllustrationData = ' + error.statusText); |
445 | } | 450 | } |
446 | ); | 451 | ); |
400-SOURCECODE/AIAHTML5.Web/app/views/ai/adam-images-detail.html
1 | <div> | 1 | <div> |
2 | <div ng-include="aap/widget/MainMenu.html"></div> | 2 | <div ng-include="aap/widget/MainMenu.html"></div> |
3 | <div ng-init="OpenAdamImageView()" id="AIView" class="aiView" ng-controller="AIController" style=" "></div> <!--position: absolute !important;--> | 3 | <div ng-init="OpenAdamImageView()" id="AIView" class="aiView" ng-controller="AIController" style=" "></div> <!--position: absolute !important;--> |
4 | +<<<<<<< origin/Develop | ||
4 | 5 | ||
5 | <style> | 6 | <style> |
6 | .jsPanel-content.jsPanel-theme-success { | 7 | .jsPanel-content.jsPanel-theme-success { |
7 | overflow-y: auto !important; | 8 | overflow-y: auto !important; |
8 | } | 9 | } |
9 | </style> | 10 | </style> |
11 | +======= | ||
12 | +<style> | ||
13 | + .jsPanel-content.jsPanel-theme-success { | ||
14 | + overflow-y: auto !important; | ||
15 | + } | ||
16 | +</style> | ||
17 | +>>>>>>> local | ||
10 | </div> | 18 | </div> |
400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
@@ -8,9 +8,9 @@ | @@ -8,9 +8,9 @@ | ||
8 | <form class="form-inline padd5"> | 8 | <form class="form-inline padd5"> |
9 | <div class="form-group"> | 9 | <div class="form-group"> |
10 | <label for="exampleInputName2" class="text-primary">Search</label> | 10 | <label for="exampleInputName2" class="text-primary">Search</label> |
11 | - <input type="text" ng-model="SearchText" class="form-control input-sm col-sm" id="txtSerachInput" placeholder=""> | 11 | + <input type="text" ng-change="hideListViewDiv()" ng-model="query.SearchText" class="form-control input-sm col-sm" id="txtSerachInput" placeholder=""> |
12 | </div> | 12 | </div> |
13 | - <button type="button" class="btn btn-primary btn-sm" ng-click="ApplySearch(SearchText)" style="margin-right:2px;"> | 13 | + <button type="button" class="btn btn-primary btn-sm" ng-click="ApplySearch(query)" style="margin-right:2px;"> |
14 | <i class="fa fa-search"></i> | 14 | <i class="fa fa-search"></i> |
15 | </button> | 15 | </button> |
16 | </form> | 16 | </form> |