Skip to content

Commit

Permalink
refactored Common.isElement
Browse files Browse the repository at this point in the history
  • Loading branch information
liabru committed May 8, 2017
1 parent d63b0c2 commit 295cffe
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/core/Common.js
Original file line number Diff line number Diff line change
Expand Up @@ -177,15 +177,7 @@ module.exports = Common;
* @return {boolean} True if the object is a HTMLElement, otherwise false
*/
Common.isElement = function(obj) {
// http://stackoverflow.com/questions/384286/javascript-isdom-how-do-you-check-if-a-javascript-object-is-a-dom-object
try {
return obj instanceof HTMLElement;
}
catch(e){
return (typeof obj==="object") &&
(obj.nodeType===1) && (typeof obj.style === "object") &&
(typeof obj.ownerDocument ==="object");
}
};

/**
Expand Down

0 comments on commit 295cffe

Please sign in to comment.