Commit d7aad16566967f172503335bc7f1b17bacee0f5b

Authored by Amrita Vishnoi
2 parents 972989e7 de053475

Merge branch 'AABug' into Develop

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
@@ -33,9 +33,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -33,9 +33,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
33 selectedorientation: '', 33 selectedorientation: '',
34 selectedimagetype: '', 34 selectedimagetype: '',
35 }; 35 };
36 - 36 + //$rootScope.isListViewRowClicked = false;
37 $scope.showTabButton = true; 37 $scope.showTabButton = true;
38 $scope.isListViewDataLoaded = true; 38 $scope.isListViewDataLoaded = true;
  39 +
39 $scope.setActiveTab = function (tabToSet) { 40 $scope.setActiveTab = function (tabToSet) {
40 41
41 $scope.activeTab = tabToSet; 42 $scope.activeTab = tabToSet;
@@ -47,6 +48,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -47,6 +48,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
47 } 48 }
48 else 49 else
49 { 50 {
  51 +
50 $('#grid-view').css("display", "none"); 52 $('#grid-view').css("display", "none");
51 if ($scope.isListViewDataLoaded == true) { 53 if ($scope.isListViewDataLoaded == true) {
52 var htm = ''; 54 var htm = '';
@@ -62,7 +64,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -62,7 +64,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
62 htm += "</tr>" 64 htm += "</tr>"
63 }); 65 });
64 htm += "</tbody></table>"; 66 htm += "</tbody></table>";
65 - $("#list-view").append(htm); 67 + $("#list-view").html(htm);
66 $compile(htm)($scope); 68 $compile(htm)($scope);
67 } 69 }
68 }); 70 });
@@ -73,8 +75,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -73,8 +75,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
73 { 75 {
74 $('#list-view').css("display", "block"); 76 $('#list-view').css("display", "block");
75 } 77 }
  78 +
  79 + $timeout(function () {
  80 + // if ($rootScope.isListViewRowClicked == true) {
  81 + // $rootScope.isListViewRowClicked = false;
  82 + $("#demoView").remove();
  83 + $("#viewList").append("<div class='col-xs-12 text-center' style='padding-top:15px;padding-bottom:15px;' id='demoView'><div class='col-xs-12' style='padding:15px;background-color:#fff;'><div class='col-xs-2' style='border:1px solid #000;padding:5px;color:#000;font-size:12px;'><div class='thumbnail' style='margin-bottom:10px;'><img style='width:auto;height:95px!important;' src=" + $rootScope.listArray[0].imageName + "></div><div class='col-xs-12' id='demoText' style='padding:0;'>" + $rootScope.listArray[0].text + "</div></div></div><a style='position:absolute;right:30px;bottom:34px;' onclick='openCurrentView(event)' href='javascript:void(0)' class='pull-right btn btn-primary'>Open</a></div>");
  84 + var moduleItemDataToBeSavedID
  85 + $("#list-view table tbody tr").removeClass("active");
  86 + var moduleItemDataToBeSavedID = localStorage.getItem("listViewSelectedID");
  87 + $("#list-view table tbody #" + moduleItemDataToBeSavedID).addClass("active");
  88 + $scope.isListViewButtonClicked = true;
  89 + // }
  90 + }, 2000);
76 } 91 }
77 -  
78 }; 92 };
79 93
80 $scope.loadForModuleById = function (moduleId) { 94 $scope.loadForModuleById = function (moduleId) {
@@ -110,25 +124,28 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -110,25 +124,28 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
110 //}); 124 //});
111 $scope.isOpenBtnClicked = false; 125 $scope.isOpenBtnClicked = false;
112 $scope.openModuleItemView = function (event) { 126 $scope.openModuleItemView = function (event) {
113 - 127 +
  128 + localStorage.setItem("activeTab", $scope.activeTab);
114 //0. Get selected Image Id 129 //0. Get selected Image Id
115 if ($scope.isListViewButtonClicked == true) { 130 if ($scope.isListViewButtonClicked == true) {
116 if ($scope.isOpenBtnClicked == true) { 131 if ($scope.isOpenBtnClicked == true) {
117 - // alert($("#demoText").html()); 132 +
118 var moduleItemDataToBeSaved = $("#demoText").html(); 133 var moduleItemDataToBeSaved = $("#demoText").html();
119 $scope.isOpenBtnClicked = false; 134 $scope.isOpenBtnClicked = false;
120 } 135 }
121 else { 136 else {
122 var moduleItemDataToBeSavedID = event.currentTarget.id; 137 var moduleItemDataToBeSavedID = event.currentTarget.id;
  138 + localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID);
123 var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text(); 139 var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text();
124 } 140 }
125 } 141 }
126 else 142 else
127 { 143 {
128 var moduleItemDataToBeSaved = event.target.id; 144 var moduleItemDataToBeSaved = event.target.id;
  145 + localStorage.setItem("listViewSelectedID", event.currentTarget.id);
129 $scope.isListViewButtonClicked = false; 146 $scope.isListViewButtonClicked = false;
130 } 147 }
131 - 148 +
132 //1.Filter selected module ietem data and get the pushed opened moduile array object 149 //1.Filter selected module ietem data and get the pushed opened moduile array object
133 $rootScope.OpenedTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData); 150 $rootScope.OpenedTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData);
134 151
@@ -138,8 +155,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -138,8 +155,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
138 $rootScope.bodySystemName = $rootScope.OpenedTileData[2]; 155 $rootScope.bodySystemName = $rootScope.OpenedTileData[2];
139 $rootScope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3]; 156 $rootScope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3];
140 $scope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3]; 157 $scope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3];
141 -  
142 - //3. set opened module item title 158 + $rootScope.listArray = [];
  159 + $rootScope.listArray.push({ "imageName": $rootScope.OpenItemImagePath, "text": moduleItemDataToBeSaved });
  160 + //3. set opened module item ti
143 localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]); 161 localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]);
144 162
145 //3. Navigate to the Module-item-view 163 //3. Navigate to the Module-item-view
@@ -149,11 +167,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -149,11 +167,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
149 167
150 168
151 $scope.openListViewModuleItem = function (event) { 169 $scope.openListViewModuleItem = function (event) {
  170 +
152 $("#demoView").remove(); 171 $("#demoView").remove();
153 var moduleItemDataToBeSavedID = event.currentTarget.id; 172 var moduleItemDataToBeSavedID = event.currentTarget.id;
  173 + $("#list-view table tbody tr").removeClass("active");
  174 + localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID);
  175 + $("#list-view table tbody #" + moduleItemDataToBeSavedID).addClass("active");
154 var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text(); 176 var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text();
155 $rootScope.OpenedTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData); 177 $rootScope.OpenedTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData);
156 $rootScope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3]; 178 $rootScope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3];
  179 + $rootScope.listArray = [];
  180 + $rootScope.listArray.push({ "imageName": $rootScope.OpenItemImagePath, "text": moduleItemDataToBeSaved });
157 $("#viewList").append("<div class='col-xs-12 text-center' style='padding-top:15px;padding-bottom:15px;' id='demoView'><div class='col-xs-12' style='padding:15px;background-color:#fff;'><div class='col-xs-2' style='border:1px solid #000;padding:5px;color:#000;font-size:12px;'><div class='thumbnail' style='margin-bottom:10px;'><img style='width:auto;height:95px!important;' src=" + $rootScope.OpenItemImagePath + "></div><div class='col-xs-12' id='demoText' style='padding:0;'>" + moduleItemDataToBeSaved + "</div></div></div><a style='position:absolute;right:30px;bottom:34px;' onclick='openCurrentView(event)' href='javascript:void(0)' class='pull-right btn btn-primary'>Open</a></div>"); 181 $("#viewList").append("<div class='col-xs-12 text-center' style='padding-top:15px;padding-bottom:15px;' id='demoView'><div class='col-xs-12' style='padding:15px;background-color:#fff;'><div class='col-xs-2' style='border:1px solid #000;padding:5px;color:#000;font-size:12px;'><div class='thumbnail' style='margin-bottom:10px;'><img style='width:auto;height:95px!important;' src=" + $rootScope.OpenItemImagePath + "></div><div class='col-xs-12' id='demoText' style='padding:0;'>" + moduleItemDataToBeSaved + "</div></div></div><a style='position:absolute;right:30px;bottom:34px;' onclick='openCurrentView(event)' href='javascript:void(0)' class='pull-right btn btn-primary'>Open</a></div>");
158 } 182 }
159 183
@@ -277,13 +301,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo @@ -277,13 +301,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
277 301
278 302
279 303
280 - 304 +
281 angular.element(document).ready(function (e) { 305 angular.element(document).ready(function (e) {
282 $("#ImagePanel").resize(function () { 306 $("#ImagePanel").resize(function () {
283 $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition); 307 $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition);
284 $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition); 308 $("#canvasDiv").scrollTop($rootScope.CanvasDivTopPosition);
285 }); 309 });
  310 + $(document).on("click", "#ImagePanel .jsPanel-hdr .jsPanel-hdr-r .jsPanel-btn-close .jsglyph-remove", function () {
  311 + $scope.setActiveTab(parseInt(localStorage.getItem("activeTab")));
  312 + //if (localStorage.getItem("activeTab") != null) {
  313 +
  314 + // $rootScope.isListViewRowClicked = true;
286 315
  316 + //}
  317 + });
287 }) 318 })
288 319
289 $scope.showAllPins = function () { 320 $scope.showAllPins = function () {
@@ -1546,6 +1577,7 @@ function openModuleItemView(event) { @@ -1546,6 +1577,7 @@ function openModuleItemView(event) {
1546 } 1577 }
1547 1578
1548 function openListViewModuleItem(event) { 1579 function openListViewModuleItem(event) {
  1580 +
1549 var scope = angular.element(document.getElementById("list-view")).scope(); 1581 var scope = angular.element(document.getElementById("list-view")).scope();
1550 scope.isListViewButtonClicked = true; 1582 scope.isListViewButtonClicked = true;
1551 scope.$apply(function () { 1583 scope.$apply(function () {
@@ -1554,6 +1586,7 @@ function openListViewModuleItem(event) { @@ -1554,6 +1586,7 @@ function openListViewModuleItem(event) {
1554 } 1586 }
1555 1587
1556 function openCurrentView(event) { 1588 function openCurrentView(event) {
  1589 +
1557 var scope = angular.element(document.getElementById("list-view")).scope(); 1590 var scope = angular.element(document.getElementById("list-view")).scope();
1558 scope.isOpenBtnClicked = true; 1591 scope.isOpenBtnClicked = true;
1559 scope.$apply(function () { 1592 scope.$apply(function () {