Commit 4f1c83db9eb5d958bbc36d41744afe8b5f969dad

Authored by Amrita Vishnoi
1 parent 862c7ea3

Against Merge Request #576.

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -77,16 +77,16 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
77 77 }
78 78  
79 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   - // }
  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 90 }, 2000);
91 91 }
92 92 };
... ... @@ -135,10 +135,10 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
135 135 }
136 136 else {
137 137 var moduleItemDataToBeSavedID = event.currentTarget.id;
138   - localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID);
  138 + localStorage.setItem("listViewSelectedID", moduleItemDataToBeSavedID);
139 139 var moduleItemDataToBeSaved = $("#list-view table tbody #" + moduleItemDataToBeSavedID).find('td:eq(0)').text();
140 140 }
141   - }
  141 + }
142 142 else
143 143 {
144 144 var moduleItemDataToBeSaved = event.target.id;
... ... @@ -230,51 +230,59 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
230 230  
231 231 //0.4 for Opening module item, load it into image
232 232 var openedImage = new Image();
  233 + openedImage.id = 'modItemImage';
233 234 openedImage.name = $rootScope.OpenItemImagePath;
234   - openedImage.onload = getImageHeightWidth;
  235 +
  236 + openedImage.onload = function () {
  237 + $scope.imageWidth = this.width;
  238 + $scope.imageHeight = this.height;
  239 +
  240 +
  241 + $timeout(function () {
  242 + $compile(aaViewElement.contents())($scope);
  243 +
  244 + if (document.getElementById('aaDetailPageDiv') != null) {
  245 +
  246 + //0.4 added some stylesheets
  247 + $('.aaBodyView').css("height", $(window).outerHeight() - $('.navbar-fixed-top').height());
  248 + $('.aaBodyView').css("width", $(window).outerWidth());
  249 + $rootScope.canvasDivHeight = $('.aaBodyView').height();
  250 +
  251 + $('.canvasDivClass').css("height", $rootScope.canvasDivHeight);
  252 +
  253 + $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
  254 + $("#modItemImage").attr('src', $rootScope.OpenItemImagePath);
  255 +
  256 +
  257 + $rootScope.ViewImageWidth = $("#modItemImage").width();
  258 + $scope.ViewImageWidth = $("#modItemImage").width();
  259 + $scope.ViewImageHeight = $("#modItemImage").height();
  260 +
  261 + $scope.relativeDimesion = 0;
  262 + $("#modItemImage").css("width", $rootScope.ViewImageWidth + "px");
  263 + //0.5 create canvas on the top of image so that I can draw a line over the canvas.
  264 + var canvas = document.createElement('canvas');
  265 + canvas.id = 'aaDetailViewCanvas';
  266 + canvas.className = '.aaCanvas'
  267 + canvas.height = parseInt(($scope.imageHeight));
  268 + canvas.width = parseInt($scope.imageWidth);
  269 + canvas.style.left = '0px';
  270 + canvas.style.top = '0px';
  271 + canvas.style.position = "absolute";
  272 + $("#canvasDiv").append(canvas);
  273 + $scope.context = canvas.getContext("2d")
  274 + //6. Show all pins on AA opened item
  275 + $scope.showAllPins();
  276 + //7. Highlight all system body list in left side
  277 + $scope.highlightBodySystemList();
  278 + }
  279 + }, 1050);
  280 + }
  281 +
235 282 openedImage.onerror = loadFailure;
236 283 openedImage.src = $rootScope.OpenItemImagePath;
237   -
238   - $timeout(function () {
239   - $compile(aaViewElement.contents())($scope);
240   -
241   - if (document.getElementById('aaDetailPageDiv') != null) {
242   -
243   - //0.4 added some stylesheets
244   - $('.aaBodyView').css("height", $(window).outerHeight() - $('.navbar-fixed-top').height());
245   - $('.aaBodyView').css("width", $(window).outerWidth());
246   - $rootScope.canvasDivHeight = $('.aaBodyView').height();
247   -
248   - $('.canvasDivClass').css("height", $rootScope.canvasDivHeight);
249   -
250   - $scope.currentTitleFromJson = localStorage.getItem("currentViewTitle");
251   - $("#modItemImage").attr('src', $rootScope.OpenItemImagePath);
252   -
253   -
254   - $rootScope.ViewImageWidth = $("#modItemImage").width();
255   - $scope.ViewImageWidth = $("#modItemImage").width();
256   - $scope.ViewImageHeight = $("#modItemImage").height();
257   -
258   - $scope.relativeDimesion = 0;
259   - $("#modItemImage").css("width", $rootScope.ViewImageWidth + "px");
260   - //0.5 create canvas on the top of image so that I can draw a line over the canvas.
261   - var canvas = document.createElement('canvas');
262   - canvas.id = 'aaDetailViewCanvas';
263   - canvas.className = '.aaCanvas'
264   - canvas.height = parseInt(($scope.imageHeight));
265   - canvas.width = parseInt($scope.imageWidth);
266   - canvas.style.left = '0px';
267   - canvas.style.top = '0px';
268   - canvas.style.position = "absolute";
269   - $("#canvasDiv").append(canvas);
270   - $scope.context = canvas.getContext("2d")
271   - //6. Show all pins on AA opened item
272   - $scope.showAllPins();
273   - //7. Highlight all system body list in left side
274   - $scope.highlightBodySystemList();
275   - }
276   - }, 1050);
277 284 }
  285 +
278 286 }
279 287  
280 288 $scope.highlightBodySystemList = function () {
... ... @@ -297,13 +305,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
297 305 return true;
298 306 }
299 307  
300   - function getImageHeightWidth() {
301   - $scope.imageWidth = this.width;
302   - $scope.imageHeight = this.height;
303   - }
304   -
305   -
306   -
307 308  
308 309 angular.element(document).ready(function (e) {
309 310 $("#ImagePanel").resize(function () {
... ...