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

Fix Problems:

preventing selecting of annotations
if Atto Modal or Moodle Modal was clicked
parent 56b4a2a8
No related branches found
No related tags found
No related merge requests found
......@@ -3926,18 +3926,32 @@ function startIndex(Y,_cm,_documentObject,_contextId, _userid,_capabilities, _to
if(clickedElement && editorNodes.querySelector(clickedElement)) {
return;
}
//If moodle Modal beeing clicked.
var modal = document.querySelectorAll('.modal.show')[0];
if(modal) {
if(clickedElement && modal.querySelector(clickedElement)) {
return;
}
}
//If attoEditor Modal beeing clicked.
var modalAtto = document.querySelectorAll('.moodle-dialogue-base')[0];
if(modalAtto) {
if(clickedElement && modalAtto.querySelector(clickedElement)) {
return;
}
}
//if the click is on an input field or link or icon in editor toolbar ('I') nothing should happen.
if(e.target.tagName === 'INPUT' || e.target.tagName === 'A' || e.target.tagName === 'SELECT' || e.target.tagName === 'I'){
if(e.target.tagName === 'INPUT' || e.target.tagName === 'A' || e.target.tagName === 'SELECT' || e.target.tagName === 'I' || e.target.tagName === "BUTTON"){
return;
}
//R: 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){
return;
}
if(!(0,_utils.findSVGAtPoint)(e.clientX,e.clientY,true)){
return;
}
handleDocumentClickFunction(e);
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment