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 33 selectedorientation: '',
34 34 selectedimagetype: '',
35 35 };
36   -
  36 + //$rootScope.isListViewRowClicked = false;
37 37 $scope.showTabButton = true;
38 38 $scope.isListViewDataLoaded = true;
  39 +
39 40 $scope.setActiveTab = function (tabToSet) {
40 41  
41 42 $scope.activeTab = tabToSet;
... ... @@ -47,6 +48,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
47 48 }
48 49 else
49 50 {
  51 +
50 52 $('#grid-view').css("display", "none");
51 53 if ($scope.isListViewDataLoaded == true) {
52 54 var htm = '';
... ... @@ -62,7 +64,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
62 64 htm += "</tr>"
63 65 });
64 66 htm += "</tbody></table>";
65   - $("#list-view").append(htm);
  67 + $("#list-view").html(htm);
66 68 $compile(htm)($scope);
67 69 }
68 70 });
... ... @@ -73,8 +75,20 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
73 75 {
74 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 94 $scope.loadForModuleById = function (moduleId) {
... ... @@ -110,25 +124,28 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
110 124 //});
111 125 $scope.isOpenBtnClicked = false;
112 126 $scope.openModuleItemView = function (event) {
113   -
  127 +
  128 + localStorage.setItem("activeTab", $scope.activeTab);
114 129 //0. Get selected Image Id
115 130 if ($scope.isListViewButtonClicked == true) {
116 131 if ($scope.isOpenBtnClicked == true) {
117   - // alert($("#demoText").html());
  132 +
118 133 var moduleItemDataToBeSaved = $("#demoText").html();
119 134 $scope.isOpenBtnClicked = false;
120 135 }
121 136 else {
122 137 var moduleItemDataToBeSavedID = event.currentTarget.id;
  138 + localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID);
123 139 var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text();
124 140 }
125 141 }
126 142 else
127 143 {
128 144 var moduleItemDataToBeSaved = event.target.id;
  145 + localStorage.setItem("listViewSelectedID", event.currentTarget.id);
129 146 $scope.isListViewButtonClicked = false;
130 147 }
131   -
  148 +
132 149 //1.Filter selected module ietem data and get the pushed opened moduile array object
133 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 155 $rootScope.bodySystemName = $rootScope.OpenedTileData[2];
139 156 $rootScope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3];
140 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 161 localStorage.setItem("currentViewTitle", $rootScope.OpenedTileData[6]);
144 162  
145 163 //3. Navigate to the Module-item-view
... ... @@ -149,11 +167,17 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
149 167  
150 168  
151 169 $scope.openListViewModuleItem = function (event) {
  170 +
152 171 $("#demoView").remove();
153 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 176 var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text();
155 177 $rootScope.OpenedTileData = ModuleService.GetOpenedTileData(moduleItemDataToBeSaved, $scope.moduleLandingData);
156 178 $rootScope.OpenItemImagePath = "../../../content/images/aa/images/" + $rootScope.OpenedTileData[3];
  179 + $rootScope.listArray = [];
  180 + $rootScope.listArray.push({ "imageName": $rootScope.OpenItemImagePath, "text": moduleItemDataToBeSaved });
157 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 301  
278 302  
279 303  
280   -
  304 +
281 305 angular.element(document).ready(function (e) {
282 306 $("#ImagePanel").resize(function () {
283 307 $("#canvasDiv").scrollLeft($rootScope.CanvasDivLeftPosition);
284 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 320 $scope.showAllPins = function () {
... ... @@ -1546,6 +1577,7 @@ function openModuleItemView(event) {
1546 1577 }
1547 1578  
1548 1579 function openListViewModuleItem(event) {
  1580 +
1549 1581 var scope = angular.element(document.getElementById("list-view")).scope();
1550 1582 scope.isListViewButtonClicked = true;
1551 1583 scope.$apply(function () {
... ... @@ -1554,6 +1586,7 @@ function openListViewModuleItem(event) {
1554 1586 }
1555 1587  
1556 1588 function openCurrentView(event) {
  1589 +
1557 1590 var scope = angular.element(document.getElementById("list-view")).scope();
1558 1591 scope.isOpenBtnClicked = true;
1559 1592 scope.$apply(function () {
... ...