MDL-67675 atto_h5p: No need to manually clear the H5P placeholder
authorShamim Rezaie <shamim@moodle.com>
Tue, 28 Jan 2020 11:28:57 +0000 (22:28 +1100)
committerShamim Rezaie <shamim@moodle.com>
Tue, 28 Jan 2020 11:28:57 +0000 (22:28 +1100)
lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button-debug.js
lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button-min.js
lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button.js
lib/editor/atto/plugins/h5p/yui/src/button/js/button.js

index 836a2bf..29ed69b 100644 (file)
Binary files a/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button-debug.js and b/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button-debug.js differ
index f18c330..41c5f75 100644 (file)
Binary files a/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button-min.js and b/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button-min.js differ
index 836a2bf..29ed69b 100644 (file)
Binary files a/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button.js and b/lib/editor/atto/plugins/h5p/yui/build/moodle-atto_h5p-button/moodle-atto_h5p-button.js differ
index 66971a8..4b753ba 100644 (file)
@@ -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.
      *