Skip to content

Commit

Permalink
Fix web-ext lint warning: UNSAFE_VAR_ASSIGNMENT
Browse files Browse the repository at this point in the history
  • Loading branch information
ylogx committed May 18, 2019
1 parent 60f2b6b commit a48d573
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
6 changes: 6 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
package:
zip -r BangDD-v0.1.0.zip *.js *.json *.md icons

lint:
web-ext lint

install_deps:
npm install --global web-ext
16 changes: 4 additions & 12 deletions bangdd.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ function onTimeToBang(event) {
}

function createButton() {
let bang_it = createElementFromHTML(
'<li id="bang_it" class="zcm__item">' +
let div = document.createElement('div');
div.innerHTML = '<li id="bang_it" class="zcm__item">' +
'<a data-zci-link="bang_it" class="zcm__link js-zci-link js-zci-link--bang_it" href="#">Google</a>' +
'</li>'
);
'</li>';
let bang_it = div.firstChild;

bang_it.addEventListener("click", function (event) {
(onTimeToBang).call(bang_it, event);
Expand All @@ -54,14 +54,6 @@ function insertInCorrectPosition(bang_it) {
}

/* Helper Methods */
function createElementFromHTML(htmlString) {
let div = document.createElement('div');
div.innerHTML = htmlString.trim();

// Change this to div.childNodes to support multiple top-level nodes
return div.firstChild;
}

function insertAfter(el, referenceNode) {
referenceNode.parentNode.insertBefore(el, referenceNode.nextSibling);
}
Expand Down

0 comments on commit a48d573

Please sign in to comment.