From 729651dd5dd0ae35d5178937b53b1b8507b84ff7 Mon Sep 17 00:00:00 2001 From: Henrik Ingo Date: Mon, 1 Jan 2018 15:27:33 +0200 Subject: [PATCH] Fix lint errors --- js/impress.js | 4 ++-- src/plugins/impressConsole/impressConsole.js | 13 ++++++++----- src/plugins/navigation/navigation.js | 9 +++++---- 3 files changed, 15 insertions(+), 11 deletions(-) diff --git a/js/impress.js b/js/impress.js index 1ea0aa7..75b4055 100644 --- a/js/impress.js +++ b/js/impress.js @@ -2965,7 +2965,7 @@ // 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. - foo = target.id; + target.id; } catch(err) { return; @@ -2995,7 +2995,7 @@ gc.addEventListener( document, "click", function( event ) { var target = event.target; try { - foo = target.id; + target.id; } catch(err) { return; diff --git a/src/plugins/impressConsole/impressConsole.js b/src/plugins/impressConsole/impressConsole.js index 6dc37e1..36cc126 100644 --- a/src/plugins/impressConsole/impressConsole.js +++ b/src/plugins/impressConsole/impressConsole.js @@ -387,11 +387,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 ); diff --git a/src/plugins/navigation/navigation.js b/src/plugins/navigation/navigation.js index 818108d..477e123 100644 --- a/src/plugins/navigation/navigation.js +++ b/src/plugins/navigation/navigation.js @@ -125,12 +125,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. - foo = target.id; + var foo = target.id; // jshint ignore:line } - catch(err) { + catch ( err ) { return; } @@ -158,9 +159,9 @@ gc.addEventListener( document, "click", function( event ) { var target = event.target; try { - foo = target.id; + var foo = target.id; // jshint ignore:line } - catch(err) { + catch ( err ) { return; }