Commit c32fc8d5e236b1e30c654ac877df3103db04c010

Authored by Nikita Kulshreshtha
1 parent 01b7c7ad

system selection is complete. green image of pin is remaining

400-SOURCECODE/AIAHTML5.Web/app/controllers/TileViewListController.js
... ... @@ -8,7 +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 + $rootScope.closeBtnImgPath = "~/../content/images/speeachBubbleClose.png";
12 12 //variables to bind Filter by Controls
13 13 $scope.searchAAListViewData = [];
14 14 $scope.SelectedAAthumbImage = [];
... ... @@ -425,7 +425,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
425 425 $scope.aaPinData = result.data.Root.Item;
426 426  
427 427 //3. get termText info
428   - alert('$scope.moduleName= ' + $scope.moduleName);
429 428 var promise = ModuleService.getTermTextForPin($scope.moduleName)
430 429 .then(
431 430 function (response) {
... ... @@ -477,7 +476,6 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
477 476  
478 477 $scope.showAnnotation = function (selectedSystemPinData)
479 478 {
480   - alert("Annotation Called First Time");
481 479  
482 480 var firstPinId = selectedSystemPinData[0]._PinId;
483 481 var pinTermNumber = selectedSystemPinData[0]._TermId;
... ... @@ -664,7 +662,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
664 662  
665 663  
666 664 $scope.createSpeechBubbleBasedOnAnnotationLength = function (pointClicked, x, y, id) {
667   - var sppechBubbleHTML = "<div id ='" + pointClicked + "' class='com'><div style='z-index:60000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.speechBubbleCounter + "'></div><div data=" + $scope.speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;font-weight:bold;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.speechBubbleCounter + " class='dynCross' style='width:18px' src=" + $rootScope.path + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + $scope.speechBubbleCounter + "'></div></div>";
  665 + var sppechBubbleHTML = "<div id ='" + pointClicked + "' class='com'><div style='z-index:60000;position:absolute;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);height:15px;width:35px;left:" + (x - 10) + "px;top:" + (y + 10) + "px;'' id='bubble" + $scope.speechBubbleCounter + "'></div><div data=" + $scope.speechBubbleCounter + " id=" + id + " class='appendDragg' style='z-index:60000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size: 12px;font-weight:bold;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;left:" + x + "px;top:" + y + "px;'><div style='z-index:7000;position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;'><img id=" + $scope.speechBubbleCounter + " class='dynCross' style='width:18px' src=" + $rootScope.closeBtnImgPath + "></div></div><div style='position:absolute;border:1px solid #000;display:none;z-index:9000;' id='bord" + $scope.speechBubbleCounter + "'></div></div>";
668 666 //Issue #7286 :Undefined annotation should not appear
669 667 for (var i = 0; i <= $scope.MultiLanguageAnnationArray.length - 1; i++) {
670 668 var annotation = $scope.MultiLanguageAnnationArray[i];
... ... @@ -715,16 +713,14 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
715 713 }
716 714 }
717 715 }
  716 + $rootScope.Globe1 = [];
718 717 $scope.createSpeechBubbleBasedOnAnnotationLengthwithoutCtrl = function (x, y, PinId) {
719   -
720   -
721   -
722   - var sppechBubbleDotHTML = '<div id="dot' + PinId + '" style="position:absolute;height:15px;width:35px;display:none;z-index:10000;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);"></div>'
  718 + var sppechBubbleDotHTML = '<div id="speechBubbleLine' + PinId + '" style="position:absolute;height:15px;width:35px;display:none;z-index:10000;border-top:2px solid #000;transform:rotate(40deg);-moz-transform:rotate(40deg);-o-transform:rotate(40deg);-ms-transform:rotate(40deg);-webkit-transform:rotate(40deg);"></div>'
723 719 + '<div id="sppeachBubble' + PinId + '" class="common-drag" style="height:auto!important;z-index:10000;margin-left:25px;border:1px solid #000;padding:5px 10px;position:absolute;color:#fff;text-align:left;font-size:12px;background-color:#19100e;border-radius:5px;-moz-border-radius:5px;-webkit-border-radius:5px;-o-border-radius:5px;-ms-border-radius:5px;font-weight:bold;">'
724 720 + '<span style="position:absolute;right:-3px;top:-4px;color:#ffffff;cursor:pointer;">'
725   - + '<img class="crossDiv_temp" style="width:18px" src=' + $rootScope.path + '></span></div>'
  721 + + '<img id="closeBtn'+PinId+'"class="crossDiv_temp" style="width:18px" src=' + $rootScope.closeBtnImgPath + '></span></div>'
726 722  
727   - + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="bord' + PinId + '">'
  723 + + '<div style="position:absolute;border:1px solid #000;display:none;z-index:9000;" id="speechBubbleDraggedLine' + PinId + '">'
728 724 + '</div>';
729 725  
730 726 //Issue #7286 :Undefined annotation should not appear
... ... @@ -795,37 +791,55 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
795 791 }
796 792 }
797 793 var Globe = [];
798   - Globe.push({ currentX: x, currentY: y });
799   - document.getElementById('dot' + PinId + '').style.display = 'block';
800   - document.getElementById('dot' + PinId + '').style.left = ((Globe[0].currentX - 45)) + 'px';
801   - document.getElementById('dot' + PinId + '').style.top = ((Globe[0].currentY) - 20) + 'px';
  794 + debugger;
  795 + $rootScope.Globe1.push({ "currentX": x, "currentY": y, "id": PinId });
  796 + Globe.push({ currentX: x, currentY: y});
  797 + document.getElementById('speechBubbleLine' + PinId + '').style.display = 'block';
  798 + document.getElementById('speechBubbleLine' + PinId + '').style.left = ((Globe[0].currentX - 45)) + 'px';
  799 + document.getElementById('speechBubbleLine' + PinId + '').style.top = ((Globe[0].currentY) - 20) + 'px';
802 800 document.getElementById('sppeachBubble' + PinId + '').style.display = 'block';
803 801 document.getElementById('sppeachBubble' + PinId + '').style.left = (Globe[0].currentX - 70) + 'px';
804 802 document.getElementById('sppeachBubble' + PinId + '').style.top = (Globe[0].currentY - 58) + 'px';
805   -
  803 +
806 804 $('.common-drag').draggable(
807 805 {
808 806 drag: function (evt) {
809   - // $("#dot").css("visibility", "hidden");
  807 + // $("#dot").css("visibility", "hidden");
810 808 var verticalScrollPosition = document.getElementById('imageDiv').scrollTop;
811 809 var horizontlScrollPosition = document.getElementById('imageDiv').scrollLeft;
812 810 var a = $(this).attr("id");
813 811  
814 812 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);
  813 + $("#speechBubbleLine" + res).css("visibility", "hidden");
  814 +
  815 + // var c = ($("#sppeachBubble" + res).css("left")).toString().replace("px", "");
  816 + // alert(c);
  817 + //var d = ($("#sppeachBubble" + res).css("top")).toString().replace("px", "");
  818 + // alert(d);
  819 + console.log("res= " + res + "x= " + x + ",y= " + y + ",evt.pageY= " + evt.page + ",evt.pageX= " + evt.pageX + ",horizontlScrollPosition= " + horizontlScrollPosition + ",verticalScrollPosition= " + verticalScrollPosition);
  820 +
  821 + // alert(evt.pageX + "X" + evt.pageY + "horizontlScrollPosition" + horizontlScrollPosition + "verticalScrollPosition" + verticalScrollPosition);
  822 + for (var i = 0; i <= $rootScope.Globe1.length - 1; i++) {
  823 + if ($rootScope.Globe1[i].id == res) {
  824 + // alert($rootScope.Globe1[i].currentX);
  825 + $scope.angle(res, $rootScope.Globe1[i].currentX, $rootScope.Globe1[i].currentY, evt.pageX + horizontlScrollPosition - $('#imageDiv').offset().left, evt.pageY + verticalScrollPosition - $('#imageDiv').offset().top, true);
  826 + }
  827 + }
  828 +
823 829 },
824 830 });
825   -
826   -
  831 + $('.crossDiv_temp').on('click', function (evt) {
  832 + var imgId = $(this).attr("id");
  833 + var pinId = imgId.substring(8, imgId.length);
  834 + $('#sppeachBubble' + pinId).remove();
  835 + $("#speechBubbleDraggedLine" + pinId).remove();
  836 + $("#speechBubbleLine" + pinId).remove();
  837 + });
  838 + }
  839 +
  840 +
827 841 $scope.angle = function (id, cx, cy, ex, ey, BoolValues) {
828   -
  842 + // debugger;
829 843 // alert(ex + " " + ey);
830 844 var dy = ey - cy;
831 845 var dx = ex - cx;
... ... @@ -849,7 +863,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
849 863 var f = cx;
850 864 // alert(d);
851 865 if (BoolValues == true) {
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%' });
  866 + $("#speechBubbleDraggedLine"+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%' });
853 867 }
854 868 else {
855 869 $("#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%' });
... ... @@ -859,7 +873,7 @@ function ($scope, $rootScope, $compile, $http, $log, $location, $timeout, DA, Mo
859 873  
860 874 }
861 875  
862   - }
  876 +
863 877 }]);
864 878  
865 879 function showSelectedSystemPins(event) {
... ...