Commit 8ac9b02652c52206447606a0ad9578b4395095ad

Authored by Nikita Kulshreshtha
2 parents 77827e1d 81f751c7

merged labelAASlider

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -294,13 +294,35 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
294 294 range: "min",
295 295 orientation: "vertical",
296 296 slide: function (event, ui) {
297   - var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
298   - scope.$apply(function () {
299   - scope.sliderVal = ui.value;
300   - scope.removeSpeechBubble();
301   - var relativeWidth = 0;
302   - var relativeHeight = 0;
303   - if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) {
  297 + changeThumbnailSize(event, ui);
  298 + },
  299 + change: function (event, ui) {
  300 +
  301 + changeThumbnailSize(event, ui);
  302 + }
  303 + })
  304 + .slider("pips", {
  305 + rest: "label",
  306 + step: "15"
  307 + });
  308 + }, 500);
  309 + }
  310 +
  311 + openedImage.onerror = loadFailure;
  312 + openedImage.src = $rootScope.OpenItemImagePath;
  313 + }
  314 +
  315 + }
  316 +
  317 +
  318 + function changeThumbnailSize(event, ui) {
  319 + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope();
  320 + scope.$apply(function () {
  321 + scope.sliderVal = ui.value;
  322 + scope.removeSpeechBubble();
  323 + var relativeWidth = 0;
  324 + var relativeHeight = 0;
  325 + if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) {
304 326 $("#listManager").css("display", "none");
305 327 $("#optionsListManagerTab").removeClass("active");
306 328 //make the head green
... ... @@ -322,107 +344,93 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou
322 344  
323 345 }, 1000);
324 346  
325   - if (ui.value == 100) {
326   - relativeWidth = scope.ViewImageWidth;
327   - relativeHeight = scope.ViewImageHeight
328   - scope.sliderPercentValue = 1.0;
329   - }
330   - else if (ui.value == 85) {
331   - relativeWidth = scope.ViewImageWidth * 0.85;
332   - relativeHeight = scope.ViewImageHeight * 0.85;
333   - scope.sliderPercentValue = 0.85;
334   -
335   - } else if (ui.value == 70) {
336   - relativeWidth = scope.ViewImageWidth * 0.70;
337   - relativeHeight = scope.ViewImageHeight * 0.70;
338   - scope.sliderPercentValue = 0.70;
339   - } else if (ui.value == 55) {
  347 + if (ui.value == 100) {
  348 + relativeWidth = scope.ViewImageWidth;
  349 + relativeHeight = scope.ViewImageHeight
  350 + scope.sliderPercentValue = 1.0;
  351 + }
  352 + else if (ui.value == 85) {
  353 + relativeWidth = scope.ViewImageWidth * 0.85;
  354 + relativeHeight = scope.ViewImageHeight * 0.85;
  355 + scope.sliderPercentValue = 0.85;
340 356  
341   - relativeWidth = scope.ViewImageWidth * 0.55;
342   - relativeHeight = scope.ViewImageHeight * 0.55;
343   - scope.sliderPercentValue = 0.55;
  357 + } else if (ui.value == 70) {
  358 + relativeWidth = scope.ViewImageWidth * 0.70;
  359 + relativeHeight = scope.ViewImageHeight * 0.70;
  360 + scope.sliderPercentValue = 0.70;
  361 + } else if (ui.value == 55) {
344 362  
345   - } else if (ui.value == 40) {
  363 + relativeWidth = scope.ViewImageWidth * 0.55;
  364 + relativeHeight = scope.ViewImageHeight * 0.55;
  365 + scope.sliderPercentValue = 0.55;
346 366  
347   - relativeWidth = scope.ViewImageWidth * 0.40;
348   - relativeHeight = scope.ViewImageHeight * 0.40;
349   - scope.sliderPercentValue = 0.40;
  367 + } else if (ui.value == 40) {
350 368  
351   - } else if (ui.value == 25) {
  369 + relativeWidth = scope.ViewImageWidth * 0.40;
  370 + relativeHeight = scope.ViewImageHeight * 0.40;
  371 + scope.sliderPercentValue = 0.40;
352 372  
353   - relativeWidth = scope.ViewImageWidth * 0.25;
354   - relativeHeight = scope.ViewImageHeight * 0.25;
355   - scope.sliderPercentValue = 0.25;
  373 + } else if (ui.value == 25) {
356 374  
357   - }
358   - }
  375 + relativeWidth = scope.ViewImageWidth * 0.25;
  376 + relativeHeight = scope.ViewImageHeight * 0.25;
  377 + scope.sliderPercentValue = 0.25;
359 378  
360   - if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) {
361   - $("#modItemImage").css("width", relativeWidth + "px");
362   - $("#modItemImage").css("height", relativeHeight + "px");
363   - $("#aaDetailViewCanvas").css("width", relativeWidth + "px");
364   - $("#modItemImage").css("height", relativeHeight + "px");
365   -
366   - $("#modItemImage").attr('src', '');
367   -
368   -
369   - $("#aaDetailViewCanvas").remove();
370   - //0.5 create canvas on the top of image so that I can draw a line over the canvas.
371   - var canvas = document.createElement('canvas');
372   - canvas.id = 'aaDetailViewCanvas';
373   - canvas.className = 'aaCanvas';
374   - canvas.height = relativeHeight;
375   - canvas.width = relativeWidth;
376   - canvas.style.left = '0px';
377   - canvas.style.top = '0px';
378   - canvas.style.position = "absolute";
379   -
380   - $("#canvasDiv").append(canvas);
381   - scope.context = canvas.getContext("2d")
382   - $("#modItemImage").attr('src', scope.OpenItemImagePath);
383   - scope.isSliderChange = true;
384   - var btnID = '';
385   - $("div.tools div:eq(1) div").each(function () {
386   - if ($(this).find("button").hasClass("btn-primary")) {
387   - btnID = $(this).find("button").attr("id");
388   - $('#' + btnID).removeClass("btn-black");
389   - $('#' + btnID).addClass("btn-primary");
390   - }
391   - });
392   - scope.isSelectedPinBtnClickedAftrSliderCange = true;
393   - switch (btnID) {
394   -
395   - case "hidePinBtn":
396   - break;
397   - case "allPinBtn":
398   - scope.showAllPins();
399   - break;
400   - case "selectedPin":
401   - scope.showAllPins();
402   - setTimeout(function () {
403   - console.log(scope.allPinDataArray);
404   - scope.activePinOnSliderChange();
405   - }, 1000);
406   - break;
407   - }
408   - }
409   -
410   - });
411   - }
412   - })
413   - .slider("pips", {
414   - rest: "label",
415   - step: "15"
416   - });
417   - }, 500);
  379 + }
418 380 }
419 381  
420   - openedImage.onerror = loadFailure;
421   - openedImage.src = $rootScope.OpenItemImagePath;
422   - }
  382 + if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) {
  383 + $("#modItemImage").css("width", relativeWidth + "px");
  384 + $("#modItemImage").css("height", relativeHeight + "px");
  385 + $("#aaDetailViewCanvas").css("width", relativeWidth + "px");
  386 + $("#modItemImage").css("height", relativeHeight + "px");
  387 +
  388 + $("#modItemImage").attr('src', '');
  389 +
  390 +
  391 + $("#aaDetailViewCanvas").remove();
  392 + //0.5 create canvas on the top of image so that I can draw a line over the canvas.
  393 + var canvas = document.createElement('canvas');
  394 + canvas.id = 'aaDetailViewCanvas';
  395 + canvas.className = 'aaCanvas';
  396 + canvas.height = relativeHeight;
  397 + canvas.width = relativeWidth;
  398 + canvas.style.left = '0px';
  399 + canvas.style.top = '0px';
  400 + canvas.style.position = "absolute";
  401 +
  402 + $("#canvasDiv").append(canvas);
  403 + scope.context = canvas.getContext("2d")
  404 + $("#modItemImage").attr('src', scope.OpenItemImagePath);
  405 + scope.isSliderChange = true;
  406 + var btnID = '';
  407 + $("div.tools div:eq(1) div").each(function () {
  408 + if ($(this).find("button").hasClass("btn-primary")) {
  409 + btnID = $(this).find("button").attr("id");
  410 + $('#' + btnID).removeClass("btn-black");
  411 + $('#' + btnID).addClass("btn-primary");
  412 + }
  413 + });
  414 + scope.isSelectedPinBtnClickedAftrSliderCange = true;
  415 + switch (btnID) {
  416 +
  417 + case "hidePinBtn":
  418 + break;
  419 + case "allPinBtn":
  420 + scope.showAllPins();
  421 + break;
  422 + case "selectedPin":
  423 + scope.showAllPins();
  424 + setTimeout(function () {
  425 + console.log(scope.allPinDataArray);
  426 + scope.activePinOnSliderChange();
  427 + }, 1000);
  428 + break;
  429 + }
  430 + }
423 431  
  432 + });
424 433 }
425   -
426 434 $scope.highlightBodySystemList = function () {
427 435 $rootScope.bodySystemNames = $rootScope.bodySystemName.trim().split(/\s*,\s*/);
428 436 var bodySystemListObj = document.getElementById("bodySystemList").getElementsByTagName("a");
... ...