Commit 01b7c7ad73c6b970cc3f65efb4f9d4ddf69946c9
1 parent
97fe1524
annotation speech bubble is draggable but second speech bubble position is not correct after drag
Showing
1 changed file
with
18 additions
and
8 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... | ... | @@ -8,6 +8,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
8 | 8 | var ATLAS_ANATOMY = 'Atlas Anatomy'; |
9 | 9 | var CLINICAL_ILLUSTRATION = 'Clinical Illustrations'; |
10 | 10 | var CLINICAL_ANIMATION = 'Clinical Animations'; |
11 | + $rootScope.path = "~/../content/images/speeachBubbleClose.png"; | |
11 | 12 | //variables to bind Filter by Controls |
12 | 13 | $scope.searchAAListViewData = []; |
13 | 14 | $scope.SelectedAAthumbImage = []; |
... | ... | @@ -806,16 +807,26 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
806 | 807 | { |
807 | 808 | drag: function (evt) { |
808 | 809 | // $("#dot").css("visibility", "hidden"); |
809 | - var verticalScrollPosition = $('#imageDiv').scrollTop; | |
810 | - var horizontlScrollPosition = $('#imageDiv').scrollLeft; | |
811 | - $scope.angle(x, y, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); | |
810 | + var verticalScrollPosition = document.getElementById('imageDiv').scrollTop; | |
811 | + var horizontlScrollPosition = document.getElementById('imageDiv').scrollLeft; | |
812 | + var a = $(this).attr("id"); | |
813 | + | |
814 | + var res = a.substring(13, a.length); | |
815 | + $("#dot" + res).css("visibility", "hidden"); | |
816 | + // var c = ($("#sppeachBubble" + res).css("left")).toString().replace("px", ""); | |
817 | + // alert(c); | |
818 | + // var d = ($("#sppeachBubble" + res).css("top")).toString().replace("px", ""); | |
819 | + // alert(d); | |
820 | + | |
821 | + // alert(evt.pageX + "X" + evt.pageY + "horizontlScrollPosition" + horizontlScrollPosition + "verticalScrollPosition" + verticalScrollPosition); | |
822 | + $scope.angle(res, x, y, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true); | |
812 | 823 | }, |
813 | 824 | }); |
814 | 825 | |
815 | 826 | |
816 | - $scope.angle = function (cx, cy, ex, ey, BoolValues) { | |
817 | - | |
827 | + $scope.angle = function (id, cx, cy, ex, ey, BoolValues) { | |
818 | 828 | |
829 | + // alert(ex + " " + ey); | |
819 | 830 | var dy = ey - cy; |
820 | 831 | var dx = ex - cx; |
821 | 832 | var theta = 0; |
... | ... | @@ -836,10 +847,9 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo |
836 | 847 | var d = Math.sqrt((cx - ex) * (cx - ex) + (cy - ey) * (cy - ey)); |
837 | 848 | var e = cy; |
838 | 849 | var f = cx; |
839 | - | |
850 | + // alert(d); | |
840 | 851 | if (BoolValues == true) { |
841 | - $("#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%' }); | |
842 | - | |
852 | + $("#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%' }); | |
843 | 853 | } |
844 | 854 | else { |
845 | 855 | $("#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%' }); | ... | ... |