Skip to content
Snippets Groups Projects
Commit 04444d04 authored by anisa kusumadewi's avatar anisa kusumadewi
Browse files

Fixed Problems:

editAnnotationMovementModal
Movement of annotation after double clicking
parent 9a045fa9
No related branches found
No related tags found
No related merge requests found
...@@ -5058,7 +5058,7 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to ...@@ -5058,7 +5058,7 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};} function _interopRequireDefault(obj){return obj&&obj.__esModule?obj:{default:obj};}
function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}} function _toConsumableArray(arr){if(Array.isArray(arr)){for(var i=0,arr2=Array(arr.length);i<arr.length;i++){arr2[i]=arr[i];}return arr2;}else{return Array.from(arr);}}
var _enabled=false; var _enabled=false;
var isDragging=false,overlay=void 0,overlayOld=void 0,annoId=0; var isDragging=false,overlay=void 0,overlayOld=void 0,annoId=0, isMoved=true;
var dragOffsetX=void 0,dragOffsetY=void 0,dragStartX=void 0,dragStartY=void 0; var dragOffsetX=void 0,dragOffsetY=void 0,dragStartX=void 0,dragStartY=void 0;
var OVERLAY_BORDER_SIZE=3; var OVERLAY_BORDER_SIZE=3;
var SIZE = 20; var SIZE = 20;
...@@ -5193,7 +5193,6 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to ...@@ -5193,7 +5193,6 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
} }
//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){ 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){
return; return;
} }
if(!(0,_utils.findSVGAtPoint)(e.clientX, e.clientY)){ if(!(0,_utils.findSVGAtPoint)(e.clientX, e.clientY)){
...@@ -5206,6 +5205,7 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to ...@@ -5206,6 +5205,7 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
} }
destroyEditOverlay(); destroyEditOverlay();
} }
isMoved = false;
} }
/** /**
* Handle document.keyup event * Handle document.keyup event
...@@ -5261,6 +5261,7 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to ...@@ -5261,6 +5261,7 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
if(x>minX&&x+overlay.offsetWidth<maxX){ if(x>minX&&x+overlay.offsetWidth<maxX){
overlay.style.left=x+'px'; overlay.style.left=x+'px';
} }
isMoved = true;
} }
/** /**
* Handle document.mouseup event * Handle document.mouseup event
...@@ -5290,8 +5291,8 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to ...@@ -5290,8 +5291,8 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
(0,_ajaxloader.showLoader)(); (0,_ajaxloader.showLoader)();
var oldX = 0; var oldX = 0;
var oldY= 0; var oldY= 0;
var viewY = 0; var viewY = dragStartY;
var viewX = 0; var viewX = dragStartX;
_PDFJSAnnotate2.default.getStoreAdapter().getAnnotation(documentId,annotationId).then(function(annotation){ _PDFJSAnnotate2.default.getStoreAdapter().getAnnotation(documentId,annotationId).then(function(annotation){
oldX = annotation['annotation'].x; oldX = annotation['annotation'].x;
oldY = annotation['annotation'].y; oldY = annotation['annotation'].y;
...@@ -5381,6 +5382,9 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to ...@@ -5381,6 +5382,9 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
if(!overlay){ if(!overlay){
return; return;
} }
if(dragStartX === viewX && dragStartY === viewY) {
return;
}
annoId=overlay.getAttribute('data-target-id'); annoId=overlay.getAttribute('data-target-id');
notification.confirm(M.util.get_string('editAnnotationTitle','pdfannotator'),M.util.get_string('editAnnotation','pdfannotator'),M.util.get_string('yesButton', 'pdfannotator'), M.util.get_string('cancelButton', 'pdfannotator'), editAnnotationCallback, overlayToOldPlace); notification.confirm(M.util.get_string('editAnnotationTitle','pdfannotator'),M.util.get_string('editAnnotation','pdfannotator'),M.util.get_string('yesButton', 'pdfannotator'), M.util.get_string('cancelButton', 'pdfannotator'), editAnnotationCallback, overlayToOldPlace);
...@@ -5474,7 +5478,11 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to ...@@ -5474,7 +5478,11 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
(0,_event.addEventListener)('annotation:click',handleAnnotationClick); (0,_event.addEventListener)('annotation:click',handleAnnotationClick);
};/** };/**
* Disable edit mode behavior. * Disable edit mode behavior.
*/function disableEdit(){destroyEditOverlay();if(!_enabled){return;}_enabled=false;document.getElementById('content-wrapper').classList.remove('cursor-edit');(0,_event.removeEventListener)('annotation:click',handleAnnotationClick);}; */function disableEdit(){
destroyEditOverlay();
if(!_enabled){return;}
_enabled=false;document.getElementById('content-wrapper').classList.remove('cursor-edit');(0,_event.removeEventListener)('annotation:click',handleAnnotationClick);
};
/***/}, /***/},
/* 30 */ /* 30 */
/***/function(module,exports,__webpack_require__){ /***/function(module,exports,__webpack_require__){
......
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
defined('MOODLE_INTERNAL') || die(); defined('MOODLE_INTERNAL') || die();
$plugin->component = 'mod_pdfannotator'; $plugin->component = 'mod_pdfannotator';
$plugin->version = 2022072700; $plugin->version = 2022072800;
$plugin->release = 'PDF Annotator v1.4 release 11'; $plugin->release = 'PDF Annotator v1.4 release 11';
$plugin->requires = 2021051700; $plugin->requires = 2021051700;
$plugin->maturity = MATURITY_STABLE; $plugin->maturity = MATURITY_STABLE;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment