Commit 81f751c7a2dd80e1fef676a5fe1d8e14f673847e
1 parent
6059d537
this is solution for the bug 28784
Showing
1 changed file
with
100 additions
and
93 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... | ... | @@ -272,100 +272,11 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
272 | 272 | range: "min", |
273 | 273 | orientation: "vertical", |
274 | 274 | slide: function (event, ui) { |
275 | - $rootScope.isSliderSlide = true; | |
276 | - var scope = angular.element(document.getElementById("aaDetailPageDiv")).scope(); | |
277 | - scope.$apply(function () { | |
278 | - scope.sliderVal = ui.value; | |
279 | - scope.removeSpeechBubble(); | |
280 | - var relativeWidth = 0; | |
281 | - var relativeHeight = 0; | |
282 | - if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) { | |
283 | - if (ui.value == 100) { | |
284 | - relativeWidth = scope.ViewImageWidth; | |
285 | - relativeHeight = scope.ViewImageHeight | |
286 | - scope.sliderPercentValue = 1.0; | |
287 | - } | |
288 | - else if (ui.value == 85) { | |
289 | - relativeWidth = scope.ViewImageWidth * 0.85; | |
290 | - relativeHeight = scope.ViewImageHeight * 0.85; | |
291 | - scope.sliderPercentValue = 0.85; | |
292 | - | |
293 | - } else if (ui.value == 70) { | |
294 | - relativeWidth = scope.ViewImageWidth * 0.70; | |
295 | - relativeHeight = scope.ViewImageHeight * 0.70; | |
296 | - scope.sliderPercentValue = 0.70; | |
297 | - } else if (ui.value == 55) { | |
298 | - | |
299 | - relativeWidth = scope.ViewImageWidth * 0.55; | |
300 | - relativeHeight = scope.ViewImageHeight * 0.55; | |
301 | - scope.sliderPercentValue = 0.55; | |
302 | - | |
303 | - } else if (ui.value == 40) { | |
304 | - | |
305 | - relativeWidth = scope.ViewImageWidth * 0.40; | |
306 | - relativeHeight = scope.ViewImageHeight * 0.40; | |
307 | - scope.sliderPercentValue = 0.40; | |
308 | - | |
309 | - } else if (ui.value == 25) { | |
310 | - | |
311 | - relativeWidth = scope.ViewImageWidth * 0.25; | |
312 | - relativeHeight = scope.ViewImageHeight * 0.25; | |
313 | - scope.sliderPercentValue = 0.25; | |
314 | - | |
315 | - } | |
316 | - } | |
317 | - | |
318 | - if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) { | |
319 | - $("#modItemImage").css("width", relativeWidth + "px"); | |
320 | - $("#modItemImage").css("height", relativeHeight + "px"); | |
321 | - $("#aaDetailViewCanvas").css("width", relativeWidth + "px"); | |
322 | - $("#modItemImage").css("height", relativeHeight + "px"); | |
323 | - | |
324 | - $("#modItemImage").attr('src', ''); | |
325 | - | |
326 | - | |
327 | - $("#aaDetailViewCanvas").remove(); | |
328 | - //0.5 create canvas on the top of image so that I can draw a line over the canvas. | |
329 | - var canvas = document.createElement('canvas'); | |
330 | - canvas.id = 'aaDetailViewCanvas'; | |
331 | - canvas.className = 'aaCanvas'; | |
332 | - canvas.height = relativeHeight; | |
333 | - canvas.width = relativeWidth; | |
334 | - canvas.style.left = '0px'; | |
335 | - canvas.style.top = '0px'; | |
336 | - canvas.style.position = "absolute"; | |
337 | - | |
338 | - $("#canvasDiv").append(canvas); | |
339 | - scope.context = canvas.getContext("2d") | |
340 | - $("#modItemImage").attr('src', scope.OpenItemImagePath); | |
341 | - scope.isSliderChange = true; | |
342 | - var btnID = ''; | |
343 | - $("div.tools div:eq(1) div").each(function () { | |
344 | - if ($(this).find("button").hasClass("btn-primary")) { | |
345 | - btnID = $(this).find("button").attr("id"); | |
346 | - $('#' + btnID).removeClass("btn-black"); | |
347 | - $('#' + btnID).addClass("btn-primary"); | |
348 | - } | |
349 | - }); | |
350 | - scope.isSelectedPinBtnClickedAftrSliderCange = true; | |
351 | - switch (btnID) { | |
352 | - | |
353 | - case "hidePinBtn": | |
354 | - break; | |
355 | - case "allPinBtn": | |
356 | - scope.showAllPins(); | |
357 | - break; | |
358 | - case "selectedPin": | |
359 | - scope.showAllPins(); | |
360 | - setTimeout(function () { | |
361 | - console.log(scope.allPinDataArray); | |
362 | - scope.activePinOnSliderChange(); | |
363 | - }, 1000); | |
364 | - break; | |
365 | - } | |
366 | - } | |
275 | + changeThumbnailSize(event, ui); | |
276 | + }, | |
277 | + change: function (event, ui) { | |
367 | 278 | |
368 | - }); | |
279 | + changeThumbnailSize(event, ui); | |
369 | 280 | } |
370 | 281 | }) |
371 | 282 | .slider("pips", { |
... | ... | @@ -381,6 +292,102 @@ function ($scope, $window, $rootScope, $compile, $http, $log, $location, $timeou |
381 | 292 | |
382 | 293 | } |
383 | 294 | |
295 | + | |
296 | + function changeThumbnailSize(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) { | |
304 | + if (ui.value == 100) { | |
305 | + relativeWidth = scope.ViewImageWidth; | |
306 | + relativeHeight = scope.ViewImageHeight | |
307 | + scope.sliderPercentValue = 1.0; | |
308 | + } | |
309 | + else if (ui.value == 85) { | |
310 | + relativeWidth = scope.ViewImageWidth * 0.85; | |
311 | + relativeHeight = scope.ViewImageHeight * 0.85; | |
312 | + scope.sliderPercentValue = 0.85; | |
313 | + | |
314 | + } else if (ui.value == 70) { | |
315 | + relativeWidth = scope.ViewImageWidth * 0.70; | |
316 | + relativeHeight = scope.ViewImageHeight * 0.70; | |
317 | + scope.sliderPercentValue = 0.70; | |
318 | + } else if (ui.value == 55) { | |
319 | + | |
320 | + relativeWidth = scope.ViewImageWidth * 0.55; | |
321 | + relativeHeight = scope.ViewImageHeight * 0.55; | |
322 | + scope.sliderPercentValue = 0.55; | |
323 | + | |
324 | + } else if (ui.value == 40) { | |
325 | + | |
326 | + relativeWidth = scope.ViewImageWidth * 0.40; | |
327 | + relativeHeight = scope.ViewImageHeight * 0.40; | |
328 | + scope.sliderPercentValue = 0.40; | |
329 | + | |
330 | + } else if (ui.value == 25) { | |
331 | + | |
332 | + relativeWidth = scope.ViewImageWidth * 0.25; | |
333 | + relativeHeight = scope.ViewImageHeight * 0.25; | |
334 | + scope.sliderPercentValue = 0.25; | |
335 | + | |
336 | + } | |
337 | + } | |
338 | + | |
339 | + if (ui.value == 25 || ui.value == 40 || ui.value == 55 || ui.value == 70 || ui.value == 85 || ui.value == 100) { | |
340 | + $("#modItemImage").css("width", relativeWidth + "px"); | |
341 | + $("#modItemImage").css("height", relativeHeight + "px"); | |
342 | + $("#aaDetailViewCanvas").css("width", relativeWidth + "px"); | |
343 | + $("#modItemImage").css("height", relativeHeight + "px"); | |
344 | + | |
345 | + $("#modItemImage").attr('src', ''); | |
346 | + | |
347 | + | |
348 | + $("#aaDetailViewCanvas").remove(); | |
349 | + //0.5 create canvas on the top of image so that I can draw a line over the canvas. | |
350 | + var canvas = document.createElement('canvas'); | |
351 | + canvas.id = 'aaDetailViewCanvas'; | |
352 | + canvas.className = 'aaCanvas'; | |
353 | + canvas.height = relativeHeight; | |
354 | + canvas.width = relativeWidth; | |
355 | + canvas.style.left = '0px'; | |
356 | + canvas.style.top = '0px'; | |
357 | + canvas.style.position = "absolute"; | |
358 | + | |
359 | + $("#canvasDiv").append(canvas); | |
360 | + scope.context = canvas.getContext("2d") | |
361 | + $("#modItemImage").attr('src', scope.OpenItemImagePath); | |
362 | + scope.isSliderChange = true; | |
363 | + var btnID = ''; | |
364 | + $("div.tools div:eq(1) div").each(function () { | |
365 | + if ($(this).find("button").hasClass("btn-primary")) { | |
366 | + btnID = $(this).find("button").attr("id"); | |
367 | + $('#' + btnID).removeClass("btn-black"); | |
368 | + $('#' + btnID).addClass("btn-primary"); | |
369 | + } | |
370 | + }); | |
371 | + scope.isSelectedPinBtnClickedAftrSliderCange = true; | |
372 | + switch (btnID) { | |
373 | + | |
374 | + case "hidePinBtn": | |
375 | + break; | |
376 | + case "allPinBtn": | |
377 | + scope.showAllPins(); | |
378 | + break; | |
379 | + case "selectedPin": | |
380 | + scope.showAllPins(); | |
381 | + setTimeout(function () { | |
382 | + console.log(scope.allPinDataArray); | |
383 | + scope.activePinOnSliderChange(); | |
384 | + }, 1000); | |
385 | + break; | |
386 | + } | |
387 | + } | |
388 | + | |
389 | + }); | |
390 | + } | |
384 | 391 | $scope.highlightBodySystemList = function () { |
385 | 392 | $rootScope.bodySystemNames = $rootScope.bodySystemName.trim().split(/\s*,\s*/); |
386 | 393 | var bodySystemListObj = document.getElementById("bodySystemList").getElementsByTagName("a"); | ... | ... |