diff --git a/.vscode/settings.json b/.vscode/settings.json index f52dc45..efd2ca6 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -34,6 +34,6 @@ "notification-toggle": false, "javascript-output-directory": "dist/js/", "javascript-output-toggle": false, - "watch": ["src/framework.js"], + "watch": ["src/framework.js", "src/**/*"], } } \ No newline at end of file diff --git a/src/framework/isElement.js b/src/framework/isElement.js index edbf422..68708ae 100644 --- a/src/framework/isElement.js +++ b/src/framework/isElement.js @@ -1,15 +1,15 @@ function isElement(obj) { try { - //Using W3 DOM2 (works for FF, Opera and Chrome) - return obj instanceof HTMLElement; + //Using W3 DOM2 (works for FF, Opera and Chrome) + return obj instanceof HTMLElement; } catch(e){ - //Browsers not supporting W3 DOM2 don't have HTMLElement and - //an exception is thrown and we end up here. Testing some - //properties that all elements have (works on IE7) - return (typeof obj==="object") && - (obj.nodeType===1) && (typeof obj.style === "object") && - (typeof obj.ownerDocument ==="object"); + //Browsers not supporting W3 DOM2 don't have HTMLElement and + //an exception is thrown and we end up here. Testing some + //properties that all elements have (works on IE7) + return (typeof obj==="object") && + (obj.nodeType===1) && (typeof obj.style === "object") && + (typeof obj.ownerDocument ==="object"); } } export {isElement}; \ No newline at end of file