Commit d3e7491c169836754739eefeb4bececc9b2c8ce6
1 parent
f67064b1
against Merge Request #740
Showing
2 changed files
with
33 additions
and
18 deletions
400-SOURCECODE/AIAHTML5.Web/app/controllers/HomeController.js
... | ... | @@ -1924,7 +1924,10 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
1924 | 1924 | } |
1925 | 1925 | //--Common code of Annotation Toolbar for CI and DA------- |
1926 | 1926 | $rootScope.DrawLineOnModuleItem = function (canvasId, LineNumber, shapestyleborderColor, shapestyleborderWidth, offsetX1, offsetY1, x, y) { |
1927 | + // alert('inside DrawLineOnModuleItem'); | |
1928 | + // alert("canvasId" + canvasId + ",LineNumber" + LineNumber + ",shapestyleborderColor" + shapestyleborderColor + ",shapestyleborderWidth" + shapestyleborderWidth + ",offsetX1" + offsetX1 + ",offsetY1" + offsetY1 + ",x" + x); | |
1927 | 1929 | if ($rootScope.isLinePreviewCompleted == true) { |
1930 | + // alert('$rootScope.isLinePreviewCompleted == true') | |
1928 | 1931 | $rootScope.isLinePreviewCompleted = false; |
1929 | 1932 | $(canvasId).addLayer({ |
1930 | 1933 | name: 'Line_' + LineNumber, |
... | ... | @@ -1936,8 +1939,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
1936 | 1939 | rounded: true, |
1937 | 1940 | x1: offsetX1, y1: offsetY1, |
1938 | 1941 | x2: x, y2: y, |
1939 | - | |
1940 | - click: function (layer) { | |
1942 | + click: function (layer) { | |
1941 | 1943 | if ($rootScope.isAnnotaionToolBarDrawingModeActive == true) { |
1942 | 1944 | //jcanvas property |
1943 | 1945 | layer.draggable = true; |
... | ... | @@ -2707,26 +2709,31 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
2707 | 2709 | $rootScope.lastX; $rootScope.lastY; |
2708 | 2710 | var ctx; |
2709 | 2711 | $rootScope.OnPaintCanvasMouseDown = function (event) { |
2710 | - | |
2712 | + event.preventDefault(); | |
2711 | 2713 | if ($rootScope.isAnnotatiomToolBarPopupClosed == false) { |
2712 | 2714 | var canvasElement = document.getElementById("canvas"); |
2713 | 2715 | var ctx = canvasElement.getContext("2d"); |
2714 | - | |
2715 | - // var x = event.clientX; | |
2716 | - // var y = event.clientY; | |
2717 | 2716 | $rootScope.offsetX1 = 0; |
2718 | 2717 | $rootScope.offsetY1 = 0; |
2719 | - //alert($location.path()); | |
2720 | - | |
2721 | 2718 | var canvasDiv = document.getElementById('canvasDiv'); |
2722 | 2719 | var verticalScrollPosition = canvasDiv.scrollTop; |
2723 | 2720 | var horizontlScrollPosition = canvasDiv.scrollLeft; |
2724 | - $rootScope.offsetX1 = event.offsetX; | |
2725 | - $rootScope.offsetY1 = event.offsetY; | |
2721 | + var $ua = navigator.userAgent; | |
2722 | + if (($ua.match(/(iPod|iPhone|iPad|android)/i))) { | |
2723 | + var verticalScrollPosition = canvasDiv.scrollTop; | |
2724 | + var horizontlScrollPosition = canvasDiv.scrollLeft; | |
2725 | + $rootScope.offsetX1 = event.pageX + horizontlScrollPosition - $('#canvasDiv').offset().left; | |
2726 | + $rootScope.offsetY1 = event.pageY + verticalScrollPosition - $('#canvasDiv').offset().top; | |
2727 | + } | |
2728 | + else | |
2729 | + { | |
2730 | + $rootScope.offsetX1 = event.offsetX; | |
2731 | + $rootScope.offsetY1 = event.offsetY; | |
2732 | + } | |
2726 | 2733 | ctx.clearRect(0, 0, 2277, 3248); |
2727 | 2734 | $rootScope.clicked = true; |
2728 | - // alert("x:"+$rootScope.offsetX1 + " y:" + $rootScope.offsetY1); | |
2729 | 2735 | canvasElement.addEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false); |
2736 | + canvasElement.addEventListener("touchmove", $rootScope.OnPaintCanvasMouseMove, false); | |
2730 | 2737 | } |
2731 | 2738 | |
2732 | 2739 | } |
... | ... | @@ -2748,14 +2755,15 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
2748 | 2755 | var storeLine = ''; |
2749 | 2756 | |
2750 | 2757 | $rootScope.OnPaintCanvasMouseUp = function (event) { |
2751 | - | |
2758 | + event.preventDefault(); | |
2752 | 2759 | if (!$rootScope.clicked) { |
2753 | 2760 | return; |
2754 | 2761 | } |
2755 | 2762 | if ($rootScope.isAnnotatiomToolBarPopupClosed == false) { |
2756 | 2763 | var AnnotationCanvas = document.getElementById('canvas'); |
2757 | 2764 | AnnotationCanvas.removeEventListener('mousemove', $rootScope.OnPaintCanvasMouseMove, false); |
2758 | - | |
2765 | + AnnotationCanvas.removeEventListener("touchmove", $rootScope.OnPaintCanvasMouseMove, false); | |
2766 | + | |
2759 | 2767 | $(".line").remove(); |
2760 | 2768 | $(".arrow").remove(); |
2761 | 2769 | $(".pin").remove(); |
... | ... | @@ -2832,6 +2840,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
2832 | 2840 | |
2833 | 2841 | } |
2834 | 2842 | $rootScope.OnPaintCanvasMouseMove = function (event) { |
2843 | + event.preventDefault(); | |
2835 | 2844 | var canvasDiv = document.getElementById('canvasDiv'); |
2836 | 2845 | var verticalScrollPosition = canvasDiv.scrollTop; |
2837 | 2846 | var horizontlScrollPosition = canvasDiv.scrollLeft; |
... | ... | @@ -3046,8 +3055,6 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3046 | 3055 | $("#font-color .minicolors .minicolors-swatch .minicolors-swatch-color").css({ "background-color": $rootScope.TextPropertyArray[i].FontColor }); |
3047 | 3056 | |
3048 | 3057 | var CurrentFontFamily = $rootScope.TextPropertyArray[i].FontFamily; |
3049 | - // alert(CurrentFontFamily); | |
3050 | - // CurrentFontFamily = CurrentFontFamily.replace(/'/g, ""); | |
3051 | 3058 | var CurrentFontSize = parseInt($rootScope.TextPropertyArray[i].FontSize); |
3052 | 3059 | $("#selected-font-family option[value=" + CurrentFontFamily + "]").prop('selected', true); |
3053 | 3060 | $("#selected-font-size option[value=" + CurrentFontSize + "]").prop('selected', true); |
... | ... | @@ -3598,7 +3605,7 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3598 | 3605 | //---- |
3599 | 3606 | |
3600 | 3607 | $rootScope.onDrawingCanvasClick = function (event) { |
3601 | - | |
3608 | + | |
3602 | 3609 | $rootScope.clicked = true; |
3603 | 3610 | // OnPaintCanvasMouseDown(event); |
3604 | 3611 | |
... | ... | @@ -3608,13 +3615,18 @@ function ($rootScope, Modules, $log, $location, $timeout, DataService, Authentic |
3608 | 3615 | annotationCanvas.addEventListener('mousedown', $rootScope.OnPaintCanvasMouseDown, false); |
3609 | 3616 | annotationCanvas.addEventListener('mouseup', $rootScope.OnPaintCanvasMouseUp, false); |
3610 | 3617 | |
3618 | + | |
3619 | + annotationCanvas.addEventListener("touchstart", $rootScope.OnPaintCanvasMouseDown, false); | |
3620 | + annotationCanvas.addEventListener("touchend", $rootScope.OnPaintCanvasMouseUp, false); | |
3621 | + | |
3611 | 3622 | } |
3612 | 3623 | |
3613 | 3624 | // alert("doclick"); |
3614 | 3625 | // annotation history |
3615 | 3626 | if (event != undefined) { |
3627 | + | |
3616 | 3628 | if ($rootScope.isAnnotaionToolBarDrawingModeActive == false) { |
3617 | - | |
3629 | + | |
3618 | 3630 | $rootScope.getAnnotationTextBasedOnSelectedBodyRegion(event); |
3619 | 3631 | |
3620 | 3632 | } | ... | ... |
400-SOURCECODE/AIAHTML5.Web/index.html
... | ... | @@ -1433,7 +1433,8 @@ |
1433 | 1433 | <!--<script src="libs/jquery/1.11.3/jquery.min.js"></script>--> |
1434 | 1434 | <script src="libs/jquery/2.1.3/jquery.min.js"></script> |
1435 | 1435 | <script src="libs/jquery/1.11.4/jquery-ui.js"></script> |
1436 | - <script src="libs/jquery/jquery_plugin/jquery.mCustomScrollbar.concat.min.js"></script> | |
1436 | + | |
1437 | + <script src="libs/jquery/jquery_plugin/jquery.mCustomScrollbar.concat.min.js"></script> | |
1437 | 1438 | <script src="themes/default/scripts/bootstrap/3.3.5/bootstrap.js"></script> |
1438 | 1439 | <script src="libs/angular/1.4.9/angular.min.js"></script> |
1439 | 1440 | <script src="libs/angular/1.4.9/angular-route.min.js"></script> |
... | ... | @@ -1481,6 +1482,8 @@ |
1481 | 1482 | <script src="app/services/TermService.js"></script> |
1482 | 1483 | <script src="libs/jquery/jquery_plugin/jqueryui.js"></script> |
1483 | 1484 | |
1485 | + <script src="https://cdnjs.cloudflare.com/ajax/libs/jqueryui-touch-punch/0.2.3/jquery.ui.touch-punch.min.js"></script> | |
1486 | + | |
1484 | 1487 | <script src="libs/jquery/jquery_plugin/color-picker/jquery.minicolors.min.js"></script> |
1485 | 1488 | <!--<script src="libs/colorpicker/jquery.minicolors.min.js"></script>--> |
1486 | 1489 | <!--<script src="libs/color-picker/jquery.minicolors.min.js"></script>--> | ... | ... |