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

Fixed a scrolling bug, added some comments

parent 91dfad23
No related branches found
No related tags found
No related merge requests found
...@@ -5936,15 +5936,17 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -5936,15 +5936,17 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
(0,_utils.disableUserSelect)(); (0,_utils.disableUserSelect)();
} }
   
// Handle document.touchstart event
function handleDocumentTouchstart(e){ function handleDocumentTouchstart(e){
document.documentElement.style.overflow = 'hidden';
document.getElementById('content-wrapper').style.overflow = 'hidden';
document.body.style.overflow = 'hidden';
var svg=void 0; var svg=void 0;
if(_type!=='area'||!(svg=(0,_utils.findSVGAtPoint)(e.touches[0].clientX,e.touches[0].clientY))){ if(_type!=='area'||!(svg=(0,_utils.findSVGAtPoint)(e.touches[0].clientX,e.touches[0].clientY))){
return; return;
} }
// Disable scrolling on the page.
document.documentElement.style.overflow = 'hidden';
document.getElementById('content-wrapper').style.overflow = 'hidden';
document.body.style.overflow = 'hidden';
var rect=svg.getBoundingClientRect(); var rect=svg.getBoundingClientRect();
originY=e.touches[0].clientY; originY=e.touches[0].clientY;
originX=e.touches[0].clientX; originX=e.touches[0].clientX;
...@@ -5975,6 +5977,7 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -5975,6 +5977,7 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
} }
} }
   
// Handle document.touchmove event
function handleDocumentTouchmove(e){ function handleDocumentTouchmove(e){
var svg=overlay.parentNode.querySelector('svg.annotationLayer'); var svg=overlay.parentNode.querySelector('svg.annotationLayer');
var rect=svg.getBoundingClientRect(); var rect=svg.getBoundingClientRect();
...@@ -6028,8 +6031,9 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -6028,8 +6031,9 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
} }
} }
} }
// Handle document.touchend event
function handleDocumentTouchend(e){ function handleDocumentTouchend(e){
// Enable the scrolling again
document.documentElement.style.overflow = 'auto'; document.documentElement.style.overflow = 'auto';
document.getElementById('content-wrapper').style.overflow = 'auto'; document.getElementById('content-wrapper').style.overflow = 'auto';
document.body.style.overflow = 'auto'; document.body.style.overflow = 'auto';
...@@ -6088,7 +6092,7 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting ...@@ -6088,7 +6092,7 @@ function startIndex(Y,_cm,_documentObject,_userid,_capabilities, _toolbarSetting
} }
function handleCancelClick(e){ function handleCancelClick(e){
// When using on mobile devices the documentscrolling will be prevented, here we have to allow it again // When using on mobile devices scrolling will be prevented, here we have to allow it again.
document.documentElement.style.overflow = 'auto'; document.documentElement.style.overflow = 'auto';
document.getElementById('content-wrapper').style.overflow = 'auto'; document.getElementById('content-wrapper').style.overflow = 'auto';
document.body.style.overflow = 'auto'; document.body.style.overflow = 'auto';
......
...@@ -25,6 +25,6 @@ ...@@ -25,6 +25,6 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->component = 'mod_pdfannotator'; // Full name of the plugin (used for diagnostics). $plugin->component = 'mod_pdfannotator'; // Full name of the plugin (used for diagnostics).
$plugin->version = 2021020300; // The current module version (Date: YYYYMMDDXX). $plugin->version = 2021020400; // The current module version (Date: YYYYMMDDXX).
$plugin->release = 'PDF Annotator v1.4 release 5'; $plugin->release = 'PDF Annotator v1.4 release 5';
$plugin->requires = 2016112900; // Requires this Moodle version. $plugin->requires = 2016112900; // Requires this Moodle version.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment