Merged
Merge Request #948
·
created by
Aiahtml bug38674 updated
From
AIAHTML_BUG38674_Updated
into
Develop
Showing
3 changed files
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'); |
... | ... | @@ -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 | 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 | 289 | |
275 | 290 | var selectimg = true; |
276 | 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 | 294 | var posbodyregion = value._Title.toLowerCase().indexOf(SearchText.toLowerCase()); |
279 | 295 | if (posbodyregion > -1) { |
280 | 296 | selectimg = true; |
... | ... | @@ -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 | 361 | $rootScope.isLoading = true; |
344 | 362 | $('ul li a').removeAttr("style"); |
345 | 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 | 369 | $scope.filterstring = true; |
349 | 370 | |
350 | 371 | while ($scope.searchAIListViewData.length) { |
351 | 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 | 377 | else { |
364 | - localStorage.setItem("AIImageId", ''); | |
365 | - | |
378 | + localStorage.setItem("SearchByAlphabet", ''); | |
366 | 379 | } |
367 | 380 | |
368 | 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 | 394 | |
382 | 395 | var selectimg = true; |
383 | 396 | //var count = 0; |
384 | - if (typeof (SearchText) !== "undefined" && (SearchText !== null && SearchText !== "")) { | |
385 | - | |
397 | + if (typeof (SearchTextByAlphabet) !== "undefined" && (SearchTextByAlphabet !== null && SearchTextByAlphabet !== "")) { | |
386 | 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 | 402 | else { |
394 | 403 | selectimg = false; |
395 | - //count = count - 1; | |
396 | 404 | } |
397 | - | |
398 | 405 | } |
399 | - | |
400 | 406 | if (selectimg === true) { |
401 | 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 | 446 | |
441 | 447 | }, |
442 | 448 | function (error) { |
443 | - // handle errors here | |
444 | 449 | console.log(' $scope.IllustrationData = ' + error.statusText); |
445 | 450 | } |
446 | 451 | ); | ... | ... |
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> | ... | ... |