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
var _enabled=false;
var data=void 0;
var _svg=void 0;
var _rect=void 0;
var dragging=false;
//Test
var textarea = void 0;
var submitbutton = void 0;
......@@ -5659,11 +5661,24 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
[textarea,data] = (0,_commentWrapper.openComment)(e,handleCancelClick,handleSubmitClick,handleToolbarClick,handleSubmitBlur,'pin');
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
*
* @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(((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;
......@@ -5724,8 +5739,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
if(!svg){
return{v:void 0};
}
var rect=svg.getBoundingClientRect();
var annotation = initializeAnnotation(rect,svg);
_rect=svg.getBoundingClientRect();
var annotation = initializeAnnotation(_rect,svg);
annotationObj = annotation;
annotation.color = true;
(0,_appendChild2.default)(svg,annotation);
......@@ -5737,8 +5752,8 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
if(!svg){
return{v:void 0};
}
var rect=svg.getBoundingClientRect();
var annotation = initializeAnnotationTouchscreen(rect,svg,coordinates);
_rect=svg.getBoundingClientRect();
var annotation = initializeAnnotationTouchscreen(_rect,svg,coordinates);
annotationObj = annotation;
annotation.color = true;
(0,_appendChild2.default)(svg,annotation);
......@@ -5787,7 +5802,7 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
var _getMetadata=(0,_utils.getMetadata)(svg);
var documentId=_getMetadata.documentId;
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";
if(document.querySelector('#anonymousCheckbox').checked){
commentVisibility = "anonymous";
......@@ -5845,7 +5860,9 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
_enabled=true;
document.getElementById('content-wrapper').classList.add('cursor-point');
document.addEventListener('mouseup',handleDocumentMouseup);
document.addEventListener('touchend',handelContentTouchend);
document.addEventListener('touchstart', handleContentTouchstart);
document.addEventListener('touchmove', handleContentTouchmove);
document.addEventListener('touchend',handleContentTouchend);
}
/**
* Disable point annotation behavior
......@@ -5853,7 +5870,9 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
_enabled=false;
document.getElementById('content-wrapper').classList.remove('cursor-point');
document.removeEventListener('mouseup',handleDocumentMouseup);
document.removeEventListener('touchend',handelContentTouchend);
document.removeEventListener('touchstart', handleContentTouchstart);
document.removeEventListener('touchmove', handleContentTouchmove);
document.removeEventListener('touchend',handleContentTouchend);
}
/***/},
/* 32 */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment