From 784a6d245bdeff7da28abdb8f811fa5fd9fcddcb Mon Sep 17 00:00:00 2001 From: Henrik Ingo Date: Mon, 1 Jan 2018 15:32:16 +0200 Subject: [PATCH] Also sync js/impress.js / Forgot to run `node build.js` --- js/impress.js | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/js/impress.js b/js/impress.js index 75b4055..cd2a87d 100644 --- a/js/impress.js +++ b/js/impress.js @@ -2316,11 +2316,14 @@ message.style.right = 0; message.style.bottom = 0; message.style.backgroundColor = 'rgba(255, 255, 255, 0.9)'; - var onClickStr = 'var x = document.getElementById(\'impress-console-button\');' + - 'x.parentNode.removeChild(x);var root = document.getElementById(\'' + rootId + '\');' + - 'impress(\'' + rootId + '\').lib.util.triggerEvent(root, \'impress:console:open\', {})'; - message.innerHTML = ''; document.body.appendChild( message ); @@ -2962,12 +2965,13 @@ // check if event target (or any of its parents is a link) var target = event.target; try { + // For example, when clicking on the button to launch speaker console, the button // is immediately deleted from the DOM. In this case target is a DOM element when // we get it, but turns out to be null if you try to actually do anything with it. - target.id; + var foo = target.id; // jshint ignore:line } - catch(err) { + catch ( err ) { return; } @@ -2995,9 +2999,9 @@ gc.addEventListener( document, "click", function( event ) { var target = event.target; try { - target.id; + var foo = target.id; // jshint ignore:line } - catch(err) { + catch ( err ) { return; }