Commit 318ffb97a0a8d264e510f6ebe0726beb14398a26
merged Develop for Adam Images bug fixes
Showing
3 changed files
with
54 additions
and
50 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... | ... | @@ -13,7 +13,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
13 | 13 | $scope.idSelected; |
14 | 14 | $scope.srollListView; |
15 | 15 | $scope.query = { |
16 | - selectedbodyregion: '', | |
16 | + SearchText: '', | |
17 | + SearchTextByAlphabet: '', | |
17 | 18 | }; |
18 | 19 | |
19 | 20 | $scope.setActiveTab = function (tabToSet) { |
... | ... | @@ -70,25 +71,36 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
70 | 71 | |
71 | 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 | 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 | 90 | $scope.loadAllAI(); |
83 | 91 | } |
92 | + else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") | |
93 | + { | |
94 | + $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet); | |
95 | + } | |
84 | 96 | else { |
85 | - $scope.ApplySearch($scope.SearchText); | |
97 | + $scope.ApplySearch($scope.query); | |
86 | 98 | } |
87 | 99 | |
88 | 100 | } |
89 | 101 | |
90 | 102 | $scope.LoadAIJsonData = function () { |
91 | - | |
103 | + $('ul li a').removeAttr("style"); | |
92 | 104 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
93 | 105 | promise.then( |
94 | 106 | function (result) { |
... | ... | @@ -110,6 +122,9 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
110 | 122 | |
111 | 123 | $scope.loadAllAI = function () { |
112 | 124 | $rootScope.isLoading = true; |
125 | + localStorage.setItem("SearchText", ''); | |
126 | + localStorage.setItem("SearchByAlphabet", ''); | |
127 | + $('ul li a').removeAttr("style"); | |
113 | 128 | $('#aiSpinner').css('visibility', 'visible'); |
114 | 129 | $('#aiSpinner').css('zIndex', '20000'); |
115 | 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 | 212 | }; |
198 | 213 | |
199 | 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 | 220 | //set localstorage values |
206 | - localStorage.setItem("AIImageId", ''); | |
221 | + localStorage.setItem("SearchText", ''); | |
222 | + localStorage.setItem("SearchByAlphabet", ''); | |
207 | 223 | localStorage.setItem("AIListViewScroll", ''); |
208 | 224 | |
209 | 225 | if ($('.selected').hasClass("selected")) { $('.selected').removeClass("selected"); } |
... | ... | @@ -216,17 +232,16 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
216 | 232 | while ($scope.searchAIListViewData.length) { |
217 | 233 | $scope.searchAIListViewData.pop(); |
218 | 234 | } |
219 | - | |
220 | 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 | 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 | 246 | $rootScope.errorMessage = AIAConstants.PLEASE_ENTER_SEARCH_TEXT; |
232 | 247 | $("#messageModal").modal('show'); |
... | ... | @@ -251,13 +266,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
251 | 266 | |
252 | 267 | |
253 | 268 | |
254 | - if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | |
269 | + if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) { | |
255 | 270 | |
256 | - localStorage.setItem("AIImageId", SearchText); | |
271 | + localStorage.setItem("SearchText", query.SearchText); | |
257 | 272 | |
258 | 273 | } |
259 | 274 | else { |
260 | - localStorage.setItem("AIImageId", ''); | |
275 | + localStorage.setItem("SearchText", ''); | |
261 | 276 | |
262 | 277 | } |
263 | 278 | |
... | ... | @@ -277,7 +292,8 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
277 | 292 | |
278 | 293 | var selectimg = true; |
279 | 294 | //var count = 0; |
280 | - if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | |
295 | + if (typeof (query.SearchText) !== "undefined" && (query.SearchText !== null && query.SearchText !== "")) { | |
296 | + var SearchText = query.SearchText | |
281 | 297 | var posbodyregion = value._Title.toLowerCase().indexOf(SearchText.toLowerCase()); |
282 | 298 | if (posbodyregion > -1) { |
283 | 299 | selectimg = true; |
... | ... | @@ -449,30 +465,27 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
449 | 465 | |
450 | 466 | |
451 | 467 | |
452 | - $scope.ApplySearchByAlphabet = function (SearchText) { | |
468 | + $scope.ApplySearchByAlphabet = function (SearchTextByAlphabet) { | |
469 | + | |
470 | + $rootScope.SearchTextByAlphabet = SearchTextByAlphabet | |
453 | 471 | $rootScope.isLoading = true; |
454 | 472 | $('ul li a').removeAttr("style"); |
455 | 473 | $('#spinner').css('visibility', 'visible'); |
456 | - $('#' + SearchText).css({"color": "white", "background-color" : "#1B92D0"}); | |
474 | + $('#' + $rootScope.SearchTextByAlphabet ).css({ "color": "white", "background-color": "#1B92D0" }); | |
475 | + | |
476 | + //color: #0095da; | |
477 | + //background-color: #ffffff; | |
457 | 478 | |
458 | 479 | $scope.filterstring = true; |
459 | 480 | |
460 | 481 | while ($scope.searchAIListViewData.length) { |
461 | 482 | $scope.searchAIListViewData.pop(); |
462 | 483 | } |
463 | - | |
464 | - | |
465 | - | |
466 | - | |
467 | - | |
468 | - if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | |
469 | - | |
470 | - localStorage.setItem("AIImageId", SearchText); | |
471 | - | |
484 | + if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { | |
485 | + localStorage.setItem("SearchByAlphabet", SearchTextByAlphabet); | |
472 | 486 | } |
473 | 487 | else { |
474 | - localStorage.setItem("AIImageId", ''); | |
475 | - | |
488 | + localStorage.setItem("SearchByAlphabet", ''); | |
476 | 489 | } |
477 | 490 | |
478 | 491 | var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') |
... | ... | @@ -491,22 +504,15 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
491 | 504 | |
492 | 505 | var selectimg = true; |
493 | 506 | //var count = 0; |
494 | - if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | |
495 | - | |
507 | + if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { | |
496 | 508 | var firstChar = value._Title[0]; |
497 | - | |
498 | - if (firstChar == SearchText) { | |
499 | - selectimg = true; | |
500 | - //count = count + 1; | |
501 | - | |
509 | + if (firstChar == SearchTextByAlphabet) { | |
510 | + selectimg = true; | |
502 | 511 | } |
503 | 512 | else { |
504 | 513 | selectimg = false; |
505 | - //count = count - 1; | |
506 | 514 | } |
507 | - | |
508 | 515 | } |
509 | - | |
510 | 516 | if (selectimg === true) { |
511 | 517 | $scope.imagePath = "~/../content/images/ai/thumbnails/" + value._ThumbnailImage; |
512 | 518 | |
... | ... | @@ -550,7 +556,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
550 | 556 | |
551 | 557 | }, |
552 | 558 | function (error) { |
553 | - // handle errors here | |
554 | 559 | console.log(' $scope.IllustrationData = ' + error.statusText); |
555 | 560 | } |
556 | 561 | ); | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/ai/adam-images-detail.html
1 | 1 | <div> |
2 | 2 | <div ng-include="aap/widget/MainMenu.html"></div> |
3 | 3 | <div ng-init="OpenAdamImageView()" id="AIView" class="aiView" ng-controller="AIController" style=" "></div> <!--position: absolute !important;--> |
4 | - | |
5 | - <style> | |
4 | + <style> | |
6 | 5 | .jsPanel-content.jsPanel-theme-success { |
7 | 6 | overflow-y: auto !important; |
8 | - } | |
7 | + } | |
9 | 8 | </style> |
10 | 9 | </div> | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/views/ai/ai-view.html
... | ... | @@ -8,9 +8,9 @@ |
8 | 8 | <form class="form-inline padd5"> |
9 | 9 | <div class="form-group"> |
10 | 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 | 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 | 14 | <i class="fa fa-search"></i> |
15 | 15 | </button> |
16 | 16 | </form> | ... | ... |