diff --git a/js/h5p.js b/js/h5p.js index bbca97f..4787d48 100644 --- a/js/h5p.js +++ b/js/h5p.js @@ -2207,23 +2207,13 @@ H5P.createTitle = function (rawTitle, maxLength) { H5P.setClipboard(clipboardItem); }; - /** - * This is a cache for pasted data to prevent parsing multiple times. - * @type {Object} - */ - var parsedClipboard = null; - /** * Retrieve parsed clipboard data. * * @return {Object} */ H5P.getClipboard = function () { - if (!parsedClipboard) { - parsedClipboard = parseClipboard(); - } - - return parsedClipboard; + return parseClipboard(); }; /** @@ -2234,9 +2224,6 @@ H5P.createTitle = function (rawTitle, maxLength) { H5P.setClipboard = function (clipboardItem) { localStorage.setItem('h5pClipboard', JSON.stringify(clipboardItem)); - // Clear cache - parsedClipboard = null; - // Trigger an event so all 'Paste' buttons may be enabled. H5P.externalDispatcher.trigger('datainclipboard', {reset: false}); }; @@ -2332,9 +2319,6 @@ H5P.createTitle = function (rawTitle, maxLength) { window.addEventListener('storage', function (event) { // Pick up clipboard changes from other tabs if (event.key === 'h5pClipboard') { - // Clear cache - parsedClipboard = null; - // Trigger an event so all 'Paste' buttons may be enabled. H5P.externalDispatcher.trigger('datainclipboard', {reset: event.newValue === null}); }