mirror of
https://github.com/moodle/moodle.git
synced 2025-04-09 02:12:22 +02:00
Merge branch 'MDL-67675-master' of git://github.com/rezaies/moodle
This commit is contained in:
commit
7b98ff28c6
@ -188,32 +188,11 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
|
||||
tagMatchRequiresAll: false
|
||||
});
|
||||
|
||||
this.editor.on(['keyup', 'cut'], this._clearH5P, this);
|
||||
this.editor.all('.h5p-placeholder').setAttribute('contenteditable', 'false');
|
||||
this.editor.delegate('dblclick', this._handleDblClick, '.h5p-placeholder', this);
|
||||
this.editor.delegate('click', this._handleClick, '.h5p-placeholder', this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Deletes elements with class .h5p-placeholder on backspace and delete.
|
||||
*
|
||||
* @method _clearH5P
|
||||
* @param {EventFacade} e
|
||||
* @private
|
||||
*/
|
||||
_clearH5P: function(e) {
|
||||
if (e.keyCode === 8 || e.keyCode === 46) {
|
||||
var parentNodes = this.get('host').getSelectedNodes().get('parentNode');
|
||||
if (parentNodes.hasOwnProperty('_nodes')) {
|
||||
var placeholder = parentNodes.filter('.h5p-placeholder');
|
||||
if (!placeholder.isEmpty()) {
|
||||
placeholder.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle a double click on a H5P Placeholder.
|
||||
*
|
||||
|
File diff suppressed because one or more lines are too long
@ -188,32 +188,11 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
|
||||
tagMatchRequiresAll: false
|
||||
});
|
||||
|
||||
this.editor.on(['keyup', 'cut'], this._clearH5P, this);
|
||||
this.editor.all('.h5p-placeholder').setAttribute('contenteditable', 'false');
|
||||
this.editor.delegate('dblclick', this._handleDblClick, '.h5p-placeholder', this);
|
||||
this.editor.delegate('click', this._handleClick, '.h5p-placeholder', this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Deletes elements with class .h5p-placeholder on backspace and delete.
|
||||
*
|
||||
* @method _clearH5P
|
||||
* @param {EventFacade} e
|
||||
* @private
|
||||
*/
|
||||
_clearH5P: function(e) {
|
||||
if (e.keyCode === 8 || e.keyCode === 46) {
|
||||
var parentNodes = this.get('host').getSelectedNodes().get('parentNode');
|
||||
if (parentNodes.hasOwnProperty('_nodes')) {
|
||||
var placeholder = parentNodes.filter('.h5p-placeholder');
|
||||
if (!placeholder.isEmpty()) {
|
||||
placeholder.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle a double click on a H5P Placeholder.
|
||||
*
|
||||
|
@ -186,32 +186,11 @@ Y.namespace('M.atto_h5p').Button = Y.Base.create('button', Y.M.editor_atto.Edito
|
||||
tagMatchRequiresAll: false
|
||||
});
|
||||
|
||||
this.editor.on(['keyup', 'cut'], this._clearH5P, this);
|
||||
this.editor.all('.h5p-placeholder').setAttribute('contenteditable', 'false');
|
||||
this.editor.delegate('dblclick', this._handleDblClick, '.h5p-placeholder', this);
|
||||
this.editor.delegate('click', this._handleClick, '.h5p-placeholder', this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Deletes elements with class .h5p-placeholder on backspace and delete.
|
||||
*
|
||||
* @method _clearH5P
|
||||
* @param {EventFacade} e
|
||||
* @private
|
||||
*/
|
||||
_clearH5P: function(e) {
|
||||
if (e.keyCode === 8 || e.keyCode === 46) {
|
||||
var parentNodes = this.get('host').getSelectedNodes().get('parentNode');
|
||||
if (parentNodes.hasOwnProperty('_nodes')) {
|
||||
var placeholder = parentNodes.filter('.h5p-placeholder');
|
||||
if (!placeholder.isEmpty()) {
|
||||
placeholder.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
e.preventDefault();
|
||||
},
|
||||
|
||||
/**
|
||||
* Handle a double click on a H5P Placeholder.
|
||||
*
|
||||
|
Loading…
x
Reference in New Issue
Block a user