More comments cleanup
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
module.exports = function(el) {
|
||||
// console.log("going to execute script", el)
|
||||
|
||||
var code = (el.text || el.textContent || el.innerHTML || "")
|
||||
var src = (el.src || "")
|
||||
var parent = el.parentNode || document.querySelector("head") || document.documentElement
|
||||
@@ -17,7 +15,7 @@ module.exports = function(el) {
|
||||
|
||||
if (src !== "") {
|
||||
script.src = src
|
||||
script.async = false // force synchronous loading of peripheral js
|
||||
script.async = false // force synchronous loading of peripheral JS
|
||||
}
|
||||
|
||||
if (code !== "") {
|
||||
|
||||
@@ -4,7 +4,7 @@ module.exports = function(els, events, opts) {
|
||||
events = (typeof events === "string" ? events.split(" ") : events)
|
||||
|
||||
events.forEach(function(e) {
|
||||
var event // = new CustomEvent(e) // doesn't everywhere yet
|
||||
var event
|
||||
event = document.createEvent("HTMLEvents")
|
||||
event.initEvent(e, true, true)
|
||||
event.eventName = e
|
||||
@@ -17,8 +17,8 @@ module.exports = function(els, events, opts) {
|
||||
forEachEls(els, function(el) {
|
||||
var domFix = false
|
||||
if (!el.parentNode && el !== document && el !== window) {
|
||||
// THANKS YOU IE (9/10//11 concerned)
|
||||
// dispatchEvent doesn't work if element is not in the dom
|
||||
// THANK YOU IE (9/10/11)
|
||||
// dispatchEvent doesn't work if the element is not in the DOM
|
||||
domFix = true
|
||||
document.body.appendChild(el)
|
||||
}
|
||||
|
||||
@@ -3,8 +3,6 @@ var evalScript = require("./eval-script")
|
||||
// Finds and executes scripts (used for newly added elements)
|
||||
// Needed since innerHTML does not run scripts
|
||||
module.exports = function(el) {
|
||||
// console.log("going to execute scripts for ", el)
|
||||
|
||||
if (el.tagName.toLowerCase() === "script") {
|
||||
evalScript(el)
|
||||
}
|
||||
|
||||
@@ -4,6 +4,6 @@ module.exports = function(els, fn, context) {
|
||||
if (els instanceof HTMLCollection || els instanceof NodeList || els instanceof Array) {
|
||||
return Array.prototype.forEach.call(els, fn, context)
|
||||
}
|
||||
// assume simple dom element
|
||||
// assume simple DOM element
|
||||
return fn.call(context, els)
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ module.exports = function() {
|
||||
if (typeof console.log === "function") {
|
||||
console.log.apply(console, arguments)
|
||||
}
|
||||
// ie is weird
|
||||
// IE is weird
|
||||
else if (console.log) {
|
||||
console.log(arguments)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user