diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
index f7f3b17..5818487 100644
--- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
+++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/AIController.js
@@ -23,99 +23,154 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet");
var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView");
- $timeout(function () {
- $("#ListViewDiv").on('scroll', function () {
- if ($scope.query.SelectedDiv == 2) {
-
- if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 10) {
- Count += 100;
- //$(window).scrollTop(0);
- var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
- if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') {
- $scope.query.SearchText = searchByText;
- }
- else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') {
- $scope.query.SearchTextByAlphabet = searchTextByAlphabet;
- }
- else {
- $scope.query.SearchTextByAlphabet = "";
- }
-
- if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") {
+ //Commented by sandeep for fixed bugs related to ADAM Images
+ //$timeout(function () {
+ // $("#ListViewDiv").on('scroll', function () {
+
+ // var searchByText = $rootScope.getLocalStorageValue("SearchText");
+ // var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet");
+ // var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView");
+ // if ($scope.query.SelectedDiv == 2) {
+
+ // if ($(this).scrollTop() + $(this).innerHeight() >= $(this)[0].scrollHeight - 10) {
+ // Count += 100;
+ // //$(window).scrollTop(0);
+ // var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
+ // if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') {
+ // $scope.query.SearchText = searchByText;
+ // }
+ // else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') {
+ // $scope.query.SearchTextByAlphabet = searchTextByAlphabet;
+ // }
+ // else {
+ // $scope.query.SearchTextByAlphabet = "";
+ // }
+
+ // if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") {
+
+ // $scope.LoadAIJsonData(Count);
+ // $scope.loadAllAI(Count);
+ // }
+ // else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") {
+ // $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet);
+ // }
+ // else {
+ // $scope.ApplySearch($scope.query);
+ // }
+ // }
+ // }
+ // });
+
+ //}, 10);
+
+ //$(window).scroll(function () {
+ // var searchByText = $rootScope.getLocalStorageValue("SearchText");
+ // var searchTextByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet");
+ // var SelectCurrTab = $rootScope.getLocalStorageValue("currentAITabView");
+ // if ($scope.query.SelectedDiv == 1) {
+
+ // if ($(window).scrollTop() == $(document).height() - $(window).height()) {
+ // Count += 100;
+ // var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
+ // if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') {
+ // $scope.query.SearchText = searchByText;
+ // }
+ // else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') {
+ // $scope.query.SearchTextByAlphabet = searchTextByAlphabet;
+ // }
+ // else {
+ // $scope.query.SearchTextByAlphabet = "";
+ // }
+
+ // if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") {
+
+ // $scope.LoadAIJsonData(Count);
+ // $scope.loadAllAI(Count);
+ // }
+ // else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") {
+ // $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet);
+ // }
+ // else {
+ // $scope.ApplySearch($scope.query);
+ // }
+ // }
+ // }
+ //});
- $scope.LoadAIJsonData(Count);
- $scope.loadAllAI(Count);
- }
- else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") {
- $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet);
- }
- else {
- $scope.ApplySearch($scope.query);
- }
- }
- }
- });
-
- }, 10);
-
- $(window).scroll(function () {
- if ($scope.query.SelectedDiv == 1) {
- if ($(window).scrollTop() == $(document).height() - $(window).height()) {
- Count += 100;
- var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
- if (typeof (searchByText) !== "undefined" && searchByText !== null && searchByText !== '') {
- $scope.query.SearchText = searchByText;
- }
- else if (typeof (searchTextByAlphabet) !== "undefined" && searchTextByAlphabet !== null && searchTextByAlphabet !== '') {
- $scope.query.SearchTextByAlphabet = searchTextByAlphabet;
- }
- else {
- $scope.query.SearchTextByAlphabet = "";
- }
-
- if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") {
-
- $scope.LoadAIJsonData(Count);
- $scope.loadAllAI(Count);
- }
- else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") {
- $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet);
- }
- else {
- $scope.ApplySearch($scope.query);
- }
- }
- }
- });
-
-
- $scope.setActiveTab = function (tabToSet) {
+
+ $scope.setActiveTab = function (tabToSet, inderectCall) {
+ //Modified code by sandeep for fixed Bugs of ADAM Images
$scope.activeTab = tabToSet;
+ localStorage.setItem("currentAITabView", "");
localStorage.setItem("currentAITabView", $scope.activeTab);
var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
var searchText = $rootScope.getLocalStorageValue("SearchText");
+ var SearchByAlphabet = $rootScope.getLocalStorageValue("SearchByAlphabet");
+
if (tabToSet == 2) {
var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId");
- $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).addClass("selected");
+ $('#' + $rootScope.getLocalStorageValue("currentAIImageId")).addClass("selected");
+
$scope.idSelected = $rootScope.getLocalStorageValue("currentAIImageId");
var selectedImageId = $rootScope.getLocalStorageValue("currentAIImageId");
- if (searchText != '') {
+ if (searchText != '' && searchText != null && searchText != undefined) {
$scope.ApplySearch(searchText);
+ if (inderectCall == true) {
+ if (curSelectedRowId != "") {
+ $scope.showItem(curSelectedRowId);
+ }
+ } else {
+ if (selectedImageId != "") {
+ $scope.filterstring = false;
+ $scope.showItem(selectedImageId);
+ $scope.filterstring = true;
+ }
+ }
}
- else {
- $scope.ReloadListViewImageDiv(selectedImageId, ImageCount);
+ else if (SearchByAlphabet != "" && SearchByAlphabet != null && SearchByAlphabet != undefined) {
+ $scope.ApplySearchByAlphabet(SearchByAlphabet);
+ if (inderectCall == true) {
+ if (curSelectedRowId != "") {
+ $scope.showItem(curSelectedRowId);
+ }
+ } else {
+ if (selectedImageId != "") {
+ $scope.filterstring = false;
+ $scope.showItem(selectedImageId);
+ $scope.filterstring = true;
+ }
+ }
}
-
+ else {
+ //ReloadListViewImageDiv(curSelectedRowId, ImageCount);
+ $scope.loadAllAI(ImageCount);
+ if (inderectCall == true) {
+ if (curSelectedRowId != "") {
+ $scope.filterstring = true;
+ $scope.showItem(curSelectedRowId);
+ $scope.filterstring = false;
+ }
+ } else {
+ if (selectedImageId != "") {
+ $scope.filterstring = false;
+ $scope.showItem(selectedImageId);
+ }
+ }
+ }
$scope.query.SelectedDiv = tabToSet;
}
else {
$('#' + $rootScope.getLocalStorageValue("currentAIImageId")).find('.thumbnail').addClass('HightLightThumbnail');
$('#' + $rootScope.getLocalStorageValue("currentAIImageId")).removeClass('selected');
$scope.query.SelectedDiv = tabToSet;
- //Add Condition for fixed bug-45300
- if (searchText != '' && searchText != null) {
+
+ //Modified Code by sandeep for fixed bug-45300
+ if (searchText != '' && searchText != null && searchText != undefined) {
$scope.ApplySearch(searchText);
}
+ else if (SearchByAlphabet != "" && SearchByAlphabet != null && SearchByAlphabet != undefined) {
+ $scope.ApplySearchByAlphabet(SearchByAlphabet);
+ }
else {
$scope.loadAllAI(ImageCount);
}
@@ -124,8 +179,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
};
- $scope.loadAIModuleById = function (moduleId) {
- debugger;
+ $scope.loadAIModuleById = function (moduleId) {
var ImageCount = $rootScope.getLocalStorageValue("ImageCount");
@@ -153,10 +207,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
$rootScope.openModules.push({ "ModuleId": 13 });
//set the local storage
-
- var curtab = $rootScope.getLocalStorageValue("currentAITabView");
+ var curtab = $rootScope.getLocalStorageValue("currentAITabView");
+ var inderectCall = true;
if (curtab == 2) {
- $scope.setActiveTab(2);
+ $scope.setActiveTab(2, inderectCall);
var curSelectedRowId = $rootScope.getLocalStorageValue("AISelectedRowId");
if (typeof (curSelectedRowId) !== "undefined" && curSelectedRowId !== null && curSelectedRowId !== '') {
$scope.reRunSearchOnLoad();
@@ -169,7 +223,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
}
}
else {
- $scope.setActiveTab(1);
+ $scope.setActiveTab(1, inderectCall);
$scope.reRunSearchOnLoad();
}
@@ -194,13 +248,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
if ($scope.query.SearchText == "" && $scope.query.SearchTextByAlphabet == "") {
$scope.loadAllAI(ImageCount);
- }
- else if ($scope.query.SearchTextByAlphabet != "" || $scope.query.SearchText == "") {
- $scope.ApplySearchByAlphabet($scope.query.SearchTextByAlphabet);
- }
- else {
- $scope.ApplySearch($scope.query);
- }
+ }
}
@@ -284,10 +332,10 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
}
- $scope.showItem = function (id) {
+ $scope.showItem = function (id) {
+ //Modified code by sandeep for fixed issue of ADAM Images
$scope.idSelected = id;
- localStorage.setItem("AISelectedRowId", id);
-
+ localStorage.setItem("AISelectedRowId", id);
//Set the vertical scroll value of the table.
var y = $('#ListViewDiv').scrollTop();
localStorage.setItem("AIListViewScroll", y);
@@ -302,10 +350,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
.where('_id = ' + id)
.select('_ThumbnailImage', '_id', '_Title');
- $scope.SelectedAIthumbImage = "~/../content/images/ai/thumbnails/" + SelectedAIthumbImage[0]._ThumbnailImage;
- $scope.SelectedAIId = SelectedAIthumbImage[0]._id;
- $scope.SelectedAITitle = SelectedAIthumbImage[0]._Title;
-
+ if (SelectedAIthumbImage.length > 0) {
+ $scope.SelectedAIthumbImage = "~/../content/images/ai/thumbnails/" + SelectedAIthumbImage[0]._ThumbnailImage;
+ $scope.SelectedAIId = SelectedAIthumbImage[0]._id;
+ $scope.SelectedAITitle = SelectedAIthumbImage[0]._Title;
+ } else { $scope.hiderow = false; }
}
else {
if ($scope.searchAIListViewData.length > 0) {
@@ -316,10 +365,11 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
.where('_id = ' + id)
.select('_ThumbnailImage', '_id', '_Title');
- $scope.SelectedAIthumbImage = "~/../content/images/ai/thumbnails/" + SelectedAIthumbImage[0]._ThumbnailImage;
- $scope.SelectedAIId = SelectedAIthumbImage[0]._id;
- $scope.SelectedAITitle = SelectedAIthumbImage[0]._Title;
-
+ if (SelectedAIthumbImage.length > 0) {
+ $scope.SelectedAIthumbImage = "~/../content/images/ai/thumbnails/" + SelectedAIthumbImage[0]._ThumbnailImage;
+ $scope.SelectedAIId = SelectedAIthumbImage[0]._id;
+ $scope.SelectedAITitle = SelectedAIthumbImage[0]._Title;
+ } else { $scope.hiderow = false; }
}
}
@@ -350,11 +400,25 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
}
$scope.ApplySearch = function (query) {
+ //Modified code by sandeep for fixed issue of ADAM Images
$('ul li span').removeAttr("style");
+
$scope.idSelected = '';
- $scope.hiderow = false;
+ //$scope.hiderow = false;
+ $scope.hiderow = true;
var currentSearchtext = $rootScope.getLocalStorageValue("SearchText");
- localStorage.setItem("SearchText", '');
+ //localStorage.setItem("SearchText", '');
+ localStorage.setItem("SearchByAlphabet", '');
+ if (typeof (query) !== "undefined" && (query !== null && query !== "")) {
+ currentSearchtext = query.SearchText;
+ $scope.query.SearchText = query.SearchText;
+ if (currentSearchtext == undefined || $scope.query.SearchText == undefined) {
+ currentSearchtext = query;
+ $scope.query.SearchText = query;
+ }
+ }
+
+ localStorage.setItem("SearchText", currentSearchtext);
if (currentSearchtext == "undefined" || (currentSearchtext == null || currentSearchtext == "")) {
if ($scope.query.SearchText == "undefined" || ($scope.query.SearchText == null || $scope.query.SearchText == "")) {
$rootScope.errorMessage = AIAConstants.PLEASE_ENTER_SEARCH_TEXT;
@@ -371,11 +435,13 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
$rootScope.isLoading = true;
$('#aiSpinner').css('visibility', 'visible');
- $scope.DisableUI();
+ $('#aiSpinner').css('zIndex', '20000');
+ //$scope.DisableUI();
$scope.filterstring = true;
if (typeof ($scope.query.SearchText) !== "undefined" && ($scope.query.SearchText !== null && $scope.query.SearchText !== "")) {
- localStorage.setItem("SearchText", query.SearchText);
- }
+ //localStorage.setItem("SearchText", query.SearchText);
+ localStorage.setItem("SearchText", $scope.query.SearchText);
+ }
else {
localStorage.setItem("SearchText", '');
}
@@ -392,7 +458,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
$('#grid-view').empty();
angular.forEach($scope.selectedAIListViewData, function (value, key) {
-
+
var selectimg = true;
//var count = 0;
if (typeof ($scope.query.SearchText) !== "undefined" && ($scope.query.SearchText !== null && $scope.query.SearchText !== "")) {
@@ -416,7 +482,7 @@ function ($scope, $window, $rootScope, $compile, $http, log, $location, $timeout
+ ''
+ '
' + value._Title + '
' + value._Title + '