From 01b7c7ad73c6b970cc3f65efb4f9d4ddf69946c9 Mon Sep 17 00:00:00 2001 From: nikita Date: Tue, 30 May 2017 13:06:21 +0530 Subject: [PATCH] annotation speech bubble is draggable but second speech bubble position is not correct after drag --- 400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js index fbe1c36..0fb2cbb 100644 --- a/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js +++ b/400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js @@ -8,6 +8,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var ATLAS_ANATOMY = 'Atlas Anatomy'; var CLINICAL_ILLUSTRATION = 'Clinical Illustrations'; var CLINICAL_ANIMATION = 'Clinical Animations'; + $rootScope.path = "~/../content/images/speeachBubbleClose.png"; //variables to bind Filter by Controls $scope.searchAAListViewData = []; $scope.SelectedAAthumbImage = []; @@ -806,16 +807,26 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo { drag: function (evt) { // $("#dot").css("visibility", "hidden"); - var verticalScrollPosition = $('#imageDiv').scrollTop; - var horizontlScrollPosition = $('#imageDiv').scrollLeft; - $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); + var verticalScrollPosition = document.getElementById('imageDiv').scrollTop; + var horizontlScrollPosition = document.getElementById('imageDiv').scrollLeft; + var a = $(this).attr("id"); + + var res = a.substring(13, a.length); + $("#dot" + res).css("visibility", "hidden"); + // var c = ($("#sppeachBubble" + res).css("left")).toString().replace("px", ""); + // alert(c); + // var d = ($("#sppeachBubble" + res).css("top")).toString().replace("px", ""); + // alert(d); + + // alert(evt.pageX + "X" + evt.pageY + "horizontlScrollPosition" + horizontlScrollPosition + "verticalScrollPosition" + verticalScrollPosition); + $scope.angle(res, x, y, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); }, }); - $scope.angle = function (cx, cy, ex, ey, BoolValues) { - + $scope.angle = function (id, cx, cy, ex, ey, BoolValues) { + // alert(ex + " " + ey); var dy = ey - cy; var dx = ex - cx; var theta = 0; @@ -836,10 +847,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo var d = Math.sqrt((cx - ex) * (cx - ex) + (cy - ey) * (cy - ey)); var e = cy; var f = cx; - + // alert(d); if (BoolValues == true) { - $("#bord").css({ 'display': 'block', 'width': d + 'px', 'top': e + 'px', 'left': f + 'px', 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%' }); - + $("#bord"+id).css({ 'display': 'block', 'width': d + 'px', 'top': e + 'px', 'left': f + 'px', 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%' }); } else { $("#bord_annotation").css({ 'display': 'block', 'width': d + 'px', 'top': e + 'px', 'left': f + 'px', 'transform': 'rotate(' + theta + 'deg)', '-moz-transform': 'rotate(' + theta + 'deg)', '-webkit-transform': 'rotate(' + theta + 'deg)', 'transform-origin': '0% 0%' }); -- libgit2 0.21.4