MDL-67675 atto_h5p: No need to manually clear the H5P placeholder
[moodle.git] / lib / editor / atto / plugins / h5p / yui / src / button / js / button.js
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.
      *