Skip to content
Snippets Groups Projects
Commit 8edc8a9b authored by hendrik.donath's avatar hendrik.donath Committed by Friederike Schwager
Browse files

Fixed pin annotation saving error, scrolling on mobile devices will no longer...

Fixed pin annotation saving error, scrolling on mobile devices will no longer move the pin annotation.
parent 47ad443f
No related branches found
No related tags found
No related merge requests found
...@@ -5631,6 +5631,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -5631,6 +5631,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
var _enabled=false; var _enabled=false;
var data=void 0; var data=void 0;
var _svg=void 0; var _svg=void 0;
var _rect=void 0;
var dragging=false;
//Test //Test
var textarea = void 0; var textarea = void 0;
var submitbutton = void 0; var submitbutton = void 0;
...@@ -5659,11 +5661,24 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -5659,11 +5661,24 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
[textarea,data] = (0,_commentWrapper.openComment)(e,handleCancelClick,handleSubmitClick,handleToolbarClick,handleSubmitBlur,'pin'); [textarea,data] = (0,_commentWrapper.openComment)(e,handleCancelClick,handleSubmitClick,handleToolbarClick,handleSubmitBlur,'pin');
renderPin(); renderPin();
} }
// Reset dragging to false.
function handleContentTouchstart(e){
dragging = false;
}
// Set dragging to true, so we stop the handleContentTouchend function from running.
function handleContentTouchmove(e){
dragging = true;
}
/** /**
* Handle content.touchend event * Handle content.touchend event
* *
* @param {Event} The DOM event to be handled * @param {Event} The DOM event to be handled
*/function handelContentTouchend(e){ */function handleContentTouchend(e){
// If the mobile user was scrolling return from this function.
if (dragging) {
return;
}
//if the click is on the Commentlist nothing should happen. //if the click is on the Commentlist nothing should happen.
if(((typeof e.target.getAttribute('id')=='string') && e.target.id.indexOf('comment') !== -1) || e.target.className.indexOf('comment') !== -1 || e.target.parentNode.className.indexOf('comment') !== -1 || e.target.parentNode.className.indexOf('chat') !== -1 || e.target.tagName == 'INPUT' || e.target.tagName == 'LABEL'){ if(((typeof e.target.getAttribute('id')=='string') && e.target.id.indexOf('comment') !== -1) || e.target.className.indexOf('comment') !== -1 || e.target.parentNode.className.indexOf('comment') !== -1 || e.target.parentNode.className.indexOf('chat') !== -1 || e.target.tagName == 'INPUT' || e.target.tagName == 'LABEL'){
return; return;
...@@ -5724,8 +5739,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -5724,8 +5739,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
if(!svg){ if(!svg){
return{v:void 0}; return{v:void 0};
} }
var rect=svg.getBoundingClientRect(); _rect=svg.getBoundingClientRect();
var annotation = initializeAnnotation(rect,svg); var annotation = initializeAnnotation(_rect,svg);
annotationObj = annotation; annotationObj = annotation;
annotation.color = true; annotation.color = true;
(0,_appendChild2.default)(svg,annotation); (0,_appendChild2.default)(svg,annotation);
...@@ -5737,8 +5752,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -5737,8 +5752,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
if(!svg){ if(!svg){
return{v:void 0}; return{v:void 0};
} }
var rect=svg.getBoundingClientRect(); _rect=svg.getBoundingClientRect();
var annotation = initializeAnnotationTouchscreen(rect,svg,coordinates); var annotation = initializeAnnotationTouchscreen(_rect,svg,coordinates);
annotationObj = annotation; annotationObj = annotation;
annotation.color = true; annotation.color = true;
(0,_appendChild2.default)(svg,annotation); (0,_appendChild2.default)(svg,annotation);
...@@ -5787,7 +5802,7 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -5787,7 +5802,7 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
var _getMetadata=(0,_utils.getMetadata)(svg); var _getMetadata=(0,_utils.getMetadata)(svg);
var documentId=_getMetadata.documentId; var documentId=_getMetadata.documentId;
var pageNumber=page; var pageNumber=page;
var annotation=Object.assign({type:'point'},(0,_utils.scaleDown)(svg,{x:clientX-((0,_utils.roundDigits)(rect.left,4)),y:clientY-((0,_utils.roundDigits)(rect.top,4))})); var annotation=Object.assign({type:'point'},(0,_utils.scaleDown)(svg,{x:clientX-((0,_utils.roundDigits)(_rect.left,4)),y:clientY-((0,_utils.roundDigits)(_rect.top,4))}));
var commentVisibility = "public"; var commentVisibility = "public";
if(document.querySelector('#anonymousCheckbox').checked){ if(document.querySelector('#anonymousCheckbox').checked){
commentVisibility = "anonymous"; commentVisibility = "anonymous";
...@@ -5845,7 +5860,9 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -5845,7 +5860,9 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
_enabled=true; _enabled=true;
document.getElementById('content-wrapper').classList.add('cursor-point'); document.getElementById('content-wrapper').classList.add('cursor-point');
document.addEventListener('mouseup',handleDocumentMouseup); document.addEventListener('mouseup',handleDocumentMouseup);
document.addEventListener('touchend',handelContentTouchend); document.addEventListener('touchstart', handleContentTouchstart);
document.addEventListener('touchmove', handleContentTouchmove);
document.addEventListener('touchend',handleContentTouchend);
} }
/** /**
* Disable point annotation behavior * Disable point annotation behavior
...@@ -5853,7 +5870,9 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -5853,7 +5870,9 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
_enabled=false; _enabled=false;
document.getElementById('content-wrapper').classList.remove('cursor-point'); document.getElementById('content-wrapper').classList.remove('cursor-point');
document.removeEventListener('mouseup',handleDocumentMouseup); document.removeEventListener('mouseup',handleDocumentMouseup);
document.removeEventListener('touchend',handelContentTouchend); document.removeEventListener('touchstart', handleContentTouchstart);
document.removeEventListener('touchmove', handleContentTouchmove);
document.removeEventListener('touchend',handleContentTouchend);
} }
/***/}, /***/},
/* 32 */ /* 32 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment