Commit ff92ae7cd51336a80595100e0d8284d7ca3d122f
1 parent
ce429382
BUG FIXING #39251
Showing
2 changed files
with
37 additions
and
73 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
... | ... | @@ -17,7 +17,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
17 | 17 | SearchTextByAlphabet: '', |
18 | 18 | SelectedDiv: '' |
19 | 19 | }; |
20 | - var Count = 200; | |
20 | + var Count = 100;//Bug#39251 | |
21 | 21 | localStorage.setItem("ImageCount", Count); |
22 | 22 | var searchByText = $rootScope.getLocalStorageValue("SearchText"); |
23 | 23 | var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet"); |
... | ... | @@ -28,7 +28,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
28 | 28 | if ($scope.query.SelectedDiv == 2) { |
29 | 29 | |
30 | 30 | if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 10) { |
31 | - Count += 100; | |
31 | + Count += 50;//Bug#39251 | |
32 | 32 | //$(window).scrollTop(0); |
33 | 33 | var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); |
34 | 34 | if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { |
... | ... | @@ -61,7 +61,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
61 | 61 | $(window).scroll(function () { |
62 | 62 | if ($scope.query.SelectedDiv == 1) { |
63 | 63 | if ($(window).scrollTop() == $(document).height() - $(window).height()) { |
64 | - Count += 100; | |
64 | + Count += 50;//Bug#39251 | |
65 | 65 | var ImageCount = $rootScope.getLocalStorageValue("ImageCount"); |
66 | 66 | if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') { |
67 | 67 | $scope.query.SearchText = searchByText; |
... | ... | @@ -203,21 +203,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
203 | 203 | |
204 | 204 | $scope.LoadAIJsonData = function (ImageCount) { |
205 | 205 | $('ul li span').removeAttr("style"); |
206 | - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | |
207 | - promise.then( | |
208 | - function (result) { | |
209 | - $scope.IllustrationData = result; | |
206 | + //Bug#39251 | |
210 | 207 | $scope.selectedAIListViewData = new jinqJs() |
211 | - .from($scope.IllustrationData.root.AIData) | |
208 | + .from($rootScope.IllustrationImageData.root.AIData) | |
212 | 209 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
213 | 210 | .select().slice(0, ImageCount); |
214 | - | |
215 | - }, | |
216 | - function (error) { | |
217 | - // handle errors here | |
218 | - console.log(' $scope.IllustrationData = ' + error.statusText); | |
219 | - } | |
220 | - ); | |
221 | 211 | }; |
222 | 212 | |
223 | 213 | $scope.loadAllAI = function (ImageCount) { |
... | ... | @@ -229,14 +219,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
229 | 219 | $('#aiSpinner').css('zIndex', '20000'); |
230 | 220 | if ($location.url() == "/ADAM-images") { |
231 | 221 | $scope.DisableUI(); |
232 | - } | |
233 | - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | |
234 | - promise.then( | |
235 | - function (result) { | |
236 | - $scope.IllustrationData = result; | |
237 | 222 | |
223 | + } //Bug#39251 | |
238 | 224 | $scope.selectedAIListViewData = new jinqJs() |
239 | - .from($scope.IllustrationData.root.AIData) | |
225 | + .from($rootScope.IllustrationImageData.root.AIData) | |
240 | 226 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
241 | 227 | .select().slice(0, ImageCount); |
242 | 228 | |
... | ... | @@ -252,11 +238,12 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
252 | 238 | $compile($e1)($scope); |
253 | 239 | |
254 | 240 | $timeout(function () { |
241 | + | |
255 | 242 | $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail'); |
256 | 243 | if ($rootScope.getLocalStorageValue('AIGridViewScroll') !== null && $location.url() == "/ADAM-images" && $scope.query.SelectedDiv == 1) { |
257 | 244 | $('html, body').animate({ scrollTop: $rootScope.getLocalStorageValue('AIGridViewScroll') }); |
258 | 245 | } |
259 | - }, 100); | |
246 | + }, 10);//Bug#39251 | |
260 | 247 | |
261 | 248 | $rootScope.isLoading = false; |
262 | 249 | $('#aiSpinner').css('visibility', 'hidden'); |
... | ... | @@ -266,14 +253,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
266 | 253 | }, 10); |
267 | 254 | } |
268 | 255 | |
269 | - | |
270 | - }, | |
271 | - function (error) { | |
272 | - // handle errors here | |
273 | - console.log(' $scope.IllustrationData = ' + error.statusText); | |
274 | - } | |
275 | - ); | |
276 | - | |
277 | 256 | } |
278 | 257 | |
279 | 258 | $scope.IsVisible = function () { |
... | ... | @@ -376,14 +355,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
376 | 355 | else { |
377 | 356 | localStorage.setItem("SearchText", ''); |
378 | 357 | } |
379 | - | |
380 | - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | |
381 | - promise.then( | |
382 | - function (result) { | |
383 | - $scope.IllustrationData = result; | |
384 | - | |
358 | + //Bug#39251 | |
385 | 359 | $scope.selectedAIListViewData = new jinqJs() |
386 | - .from($scope.IllustrationData.root.AIData) | |
360 | + .from($rootScope.IllustrationImageData.root.AIData) | |
361 | + .where(function (value, key){return value._Title.toLowerCase().indexOf($scope.query.SearchText.toLowerCase());}) | |
387 | 362 | .orderBy([{ field: '_Title', sort: 'asc' }]) |
388 | 363 | .select(); |
389 | 364 | |
... | ... | @@ -441,13 +416,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
441 | 416 | $scope.EnableUI(); |
442 | 417 | |
443 | 418 | }, 10); |
444 | - | |
445 | - }, | |
446 | - function (error) { | |
447 | - // handle errors here | |
448 | - console.log(' $scope.IllustrationData = ' + error.statusText); | |
449 | - } | |
450 | - ); | |
451 | 419 | } |
452 | 420 | $scope.DisableUI = function () { |
453 | 421 | |
... | ... | @@ -482,13 +450,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
482 | 450 | else { |
483 | 451 | localStorage.setItem("SearchByAlphabet", ''); |
484 | 452 | } |
485 | - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | |
486 | - promise.then( | |
487 | - function (result) { | |
488 | - $scope.IllustrationData = result; | |
489 | - | |
453 | + //Bug#39251 | |
490 | 454 | $scope.selectedAIListViewData = new jinqJs() |
491 | - .from($scope.IllustrationData.root.AIData) | |
455 | + .from($rootScope.IllustrationImageData.root.AIData) | |
456 | + .where(function (value, key) { return value._Title[0] === SearchTextByAlphabet; }) | |
492 | 457 | .orderBy([{ field: '_Title', sort: 'asc' }]).select(); |
493 | 458 | |
494 | 459 | $('#grid-view').empty(); |
... | ... | @@ -538,15 +503,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
538 | 503 | $('#ListViewDiv').append('<tr id="searchItem"><td colspan="6"><strong style="color:black;">No illustration found for the selected search criteria!</strong></td></tr>'); |
539 | 504 | } |
540 | 505 | $rootScope.isLoading = false; |
541 | - | |
542 | - setTimeout(function () { | |
543 | - $scope.EnableUI(); | |
544 | - }, 10); | |
545 | - }, | |
546 | - function (error) { | |
547 | - console.log(' $scope.IllustrationData = ' + error.statusText); | |
548 | - } | |
549 | - ); | |
506 | + $scope.EnableUI(); | |
507 | + //setTimeout(function () { | |
508 | + // $scope.EnableUI(); | |
509 | + //}, 10); | |
550 | 510 | } |
551 | 511 | |
552 | 512 | |
... | ... | @@ -691,14 +651,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
691 | 651 | $rootScope.isLoading = true; |
692 | 652 | $('#aiSpinner').css('visibility', 'visible'); |
693 | 653 | $('#aiSpinner').css('zIndex', '20000'); |
694 | - var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json') | |
695 | - promise.then( | |
696 | - function (result) { | |
697 | - $scope.IllustrationData = result; | |
698 | - | |
654 | + //Bug#39251 | |
699 | 655 | var SelectedAIthumbImage = []; |
700 | 656 | SelectedAIthumbImage = new jinqJs() |
701 | - .from($scope.IllustrationData.root.AIData) | |
657 | + .from($rootScope.IllustrationImageData.root.AIData) | |
702 | 658 | .where('_id = ' + id) |
703 | 659 | .select('_ThumbnailImage', '_id', '_Title').slice(0, imgCount); |
704 | 660 | |
... | ... | @@ -720,13 +676,6 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout |
720 | 676 | } |
721 | 677 | $rootScope.isLoading = false; |
722 | 678 | $('#aiSpinner').css('visibility', 'hidden'); |
723 | - | |
724 | - }, | |
725 | - function (error) { | |
726 | - // handle errors here | |
727 | - console.log(' $scope.AnimationData = ' + error.statusText); | |
728 | - } | |
729 | - ); | |
730 | 679 | }; |
731 | 680 | |
732 | 681 | $scope.hideListViewDiv = function () { | ... | ... |
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -189,6 +189,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
189 | 189 | } |
190 | 190 | |
191 | 191 | $rootScope.getConfigurationValues(); |
192 | + $rootScope.LoadIllustrationImageData();//Start Bug#39251 | |
192 | 193 | } |
193 | 194 | } |
194 | 195 | $rootScope.getConfigurationValues = function () { |
... | ... | @@ -437,7 +438,7 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
437 | 438 | |
438 | 439 | |
439 | 440 | $scope.ValidateClientSiteUrl = function () { |
440 | - debugger | |
441 | + | |
441 | 442 | $rootScope.isCallFromSite = true; |
442 | 443 | |
443 | 444 | var siteInfo = params.split('&'); |
... | ... | @@ -5757,6 +5758,20 @@ function ($rootScope, $scope, Modules, $log, $location, $timeout, DataService, A |
5757 | 5758 | |
5758 | 5759 | }; |
5759 | 5760 | |
5761 | + //Start Bug#39251 | |
5762 | + $rootScope.LoadIllustrationImageData = function () { | |
5763 | + var promise = DataService.getJson('~/../content/data/json/ai/ai_dat_contentlist.json'); | |
5764 | + promise.then( | |
5765 | + function (result) { | |
5766 | + $rootScope.IllustrationImageData = result; | |
5767 | + }, | |
5768 | + function (error) { | |
5769 | + // handle errors here | |
5770 | + console.log(' $scope.IllustrationImageData = ' + error.statusText); | |
5771 | + } | |
5772 | + ); | |
5773 | + }; | |
5774 | + //END Bug#39251 | |
5760 | 5775 | }] |
5761 | 5776 | ); |
5762 | 5777 | ... | ... |