From 81f751c7a2dd80e1fef676a5fe1d8e14f673847e Mon Sep 17 00:00:00 2001 From: Mukul Date: Wed, 28 Feb 2018 19:29:59 +0530 Subject: [PATCH] this is solution for the bug 28784 --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 193 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------------------------------------------------------------------------------- 1 file changed, 100 insertions(+), 93 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index 7e170cc..a518fae 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -272,100 +272,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou range: "min", orientation: "vertical", slide: function (event, ui) { - $rootScope.isSliderSlide = true; - var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); - scope.$apply(function () { - scope.sliderVal = ui.value; - scope.removeSpeechBubble(); - var relativeWidth = 0; - var relativeHeight = 0; - if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) { - if (ui.value == 100) { - relativeWidth = scope.ViewImageWidth; - relativeHeight = scope.ViewImageHeight - scope.sliderPercentValue = 1.0; - } - else if (ui.value == 85) { - relativeWidth = scope.ViewImageWidth * 0.85; - relativeHeight = scope.ViewImageHeight * 0.85; - scope.sliderPercentValue = 0.85; - - } else if (ui.value == 70) { - relativeWidth = scope.ViewImageWidth * 0.70; - relativeHeight = scope.ViewImageHeight * 0.70; - scope.sliderPercentValue = 0.70; - } else if (ui.value == 55) { - - relativeWidth = scope.ViewImageWidth * 0.55; - relativeHeight = scope.ViewImageHeight * 0.55; - scope.sliderPercentValue = 0.55; - - } else if (ui.value == 40) { - - relativeWidth = scope.ViewImageWidth * 0.40; - relativeHeight = scope.ViewImageHeight * 0.40; - scope.sliderPercentValue = 0.40; - - } else if (ui.value == 25) { - - relativeWidth = scope.ViewImageWidth * 0.25; - relativeHeight = scope.ViewImageHeight * 0.25; - scope.sliderPercentValue = 0.25; - - } - } - - if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) { - $("#modItemImage").css("width", relativeWidth + "px"); - $("#modItemImage").css("height", relativeHeight + "px"); - $("#aaDetailViewCanvas").css("width", relativeWidth + "px"); - $("#modItemImage").css("height", relativeHeight + "px"); - - $("#modItemImage").attr('src', ''); - - - $("#aaDetailViewCanvas").remove(); - //0.5 create canvas on the top of image so that I can draw a line over the canvas. - var canvas = document.createElement('canvas'); - canvas.id = 'aaDetailViewCanvas'; - canvas.className = 'aaCanvas'; - canvas.height = relativeHeight; - canvas.width = relativeWidth; - canvas.style.left = '0px'; - canvas.style.top = '0px'; - canvas.style.position = "absolute"; - - $("#canvasDiv").append(canvas); - scope.context = canvas.getContext("2d") - $("#modItemImage").attr('src', scope.OpenItemImagePath); - scope.isSliderChange = true; - var btnID = ''; - $("div.tools div:eq(1) div").each(function () { - if ($(this).find("button").hasClass("btn-primary")) { - btnID = $(this).find("button").attr("id"); - $('#' + btnID).removeClass("btn-black"); - $('#' + btnID).addClass("btn-primary"); - } - }); - scope.isSelectedPinBtnClickedAftrSliderCange = true; - switch (btnID) { - - case "hidePinBtn": - break; - case "allPinBtn": - scope.showAllPins(); - break; - case "selectedPin": - scope.showAllPins(); - setTimeout(function () { - console.log(scope.allPinDataArray); - scope.activePinOnSliderChange(); - }, 1000); - break; - } - } + changeThumbnailSize(event, ui); + }, + change: function (event, ui) { - }); + changeThumbnailSize(event, ui); } }) .slider("pips", { @@ -381,6 +292,102 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou } + + function changeThumbnailSize(event, ui) { + var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); + scope.$apply(function () { + scope.sliderVal = ui.value; + scope.removeSpeechBubble(); + var relativeWidth = 0; + var relativeHeight = 0; + if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) { + if (ui.value == 100) { + relativeWidth = scope.ViewImageWidth; + relativeHeight = scope.ViewImageHeight + scope.sliderPercentValue = 1.0; + } + else if (ui.value == 85) { + relativeWidth = scope.ViewImageWidth * 0.85; + relativeHeight = scope.ViewImageHeight * 0.85; + scope.sliderPercentValue = 0.85; + + } else if (ui.value == 70) { + relativeWidth = scope.ViewImageWidth * 0.70; + relativeHeight = scope.ViewImageHeight * 0.70; + scope.sliderPercentValue = 0.70; + } else if (ui.value == 55) { + + relativeWidth = scope.ViewImageWidth * 0.55; + relativeHeight = scope.ViewImageHeight * 0.55; + scope.sliderPercentValue = 0.55; + + } else if (ui.value == 40) { + + relativeWidth = scope.ViewImageWidth * 0.40; + relativeHeight = scope.ViewImageHeight * 0.40; + scope.sliderPercentValue = 0.40; + + } else if (ui.value == 25) { + + relativeWidth = scope.ViewImageWidth * 0.25; + relativeHeight = scope.ViewImageHeight * 0.25; + scope.sliderPercentValue = 0.25; + + } + } + + if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) { + $("#modItemImage").css("width", relativeWidth + "px"); + $("#modItemImage").css("height", relativeHeight + "px"); + $("#aaDetailViewCanvas").css("width", relativeWidth + "px"); + $("#modItemImage").css("height", relativeHeight + "px"); + + $("#modItemImage").attr('src', ''); + + + $("#aaDetailViewCanvas").remove(); + //0.5 create canvas on the top of image so that I can draw a line over the canvas. + var canvas = document.createElement('canvas'); + canvas.id = 'aaDetailViewCanvas'; + canvas.className = 'aaCanvas'; + canvas.height = relativeHeight; + canvas.width = relativeWidth; + canvas.style.left = '0px'; + canvas.style.top = '0px'; + canvas.style.position = "absolute"; + + $("#canvasDiv").append(canvas); + scope.context = canvas.getContext("2d") + $("#modItemImage").attr('src', scope.OpenItemImagePath); + scope.isSliderChange = true; + var btnID = ''; + $("div.tools div:eq(1) div").each(function () { + if ($(this).find("button").hasClass("btn-primary")) { + btnID = $(this).find("button").attr("id"); + $('#' + btnID).removeClass("btn-black"); + $('#' + btnID).addClass("btn-primary"); + } + }); + scope.isSelectedPinBtnClickedAftrSliderCange = true; + switch (btnID) { + + case "hidePinBtn": + break; + case "allPinBtn": + scope.showAllPins(); + break; + case "selectedPin": + scope.showAllPins(); + setTimeout(function () { + console.log(scope.allPinDataArray); + scope.activePinOnSliderChange(); + }, 1000); + break; + } + } + + }); + } $scope.highlightBodySystemList = function () { $rootScope.bodySystemNames = $rootScope.bodySystemName.trim().split(/\s*,\s*/); var bodySystemListObj = document.getElementById("bodySystemList").getElementsByTagName("a"); -- libgit2 0.21.4