MDL-46088 Quiz: Prevent alert when clicking in editor in secure popup

This commit is contained in:
Damyon Wiese 2014-09-16 10:41:54 +08:00 committed by Tim Hunt
parent 339554aa21
commit d250083e03

View File

@ -222,7 +222,7 @@ M.mod_quiz.secure_window = {
Y.delegate('mousedown', M.mod_quiz.secure_window.prevent_mouse, 'body', '*');
Y.delegate('mouseup', M.mod_quiz.secure_window.prevent_mouse, 'body', '*');
Y.delegate('dragstart', M.mod_quiz.secure_window.prevent, document, '*');
Y.delegate('selectstart', M.mod_quiz.secure_window.prevent, document, '*');
Y.delegate('selectstart', M.mod_quiz.secure_window.prevent_selection, document, '*');
Y.delegate('cut', M.mod_quiz.secure_window.prevent, document, '*');
Y.delegate('copy', M.mod_quiz.secure_window.prevent, document, '*');
Y.delegate('paste', M.mod_quiz.secure_window.prevent, document, '*');
@ -246,6 +246,16 @@ M.mod_quiz.secure_window = {
setTimeout(M.mod_quiz.secure_window.clear_status, 10);
},
/**
* Prevent the selection event without showing an alert.
*
* @method prevent_selection
* @param {EventFacade} e
*/
prevent_selection: function(e) {
return false;
},
prevent: function(e) {
alert(M.str.quiz.functiondisabledbysecuremode);
e.halt();