0
0
Fork 0
mirror of https://github.com/liabru/matter-js.git synced 2024-11-27 09:50:52 -05:00

fix Common.isElement, closes #501, closes #507, closes #459, closes #468, closes #517

This commit is contained in:
liabru 2017-11-22 21:26:01 +00:00
parent 9eae36f50d
commit 18a084574e

View file

@ -177,7 +177,11 @@ module.exports = Common;
* @return {boolean} True if the object is a HTMLElement, otherwise false
*/
Common.isElement = function(obj) {
return obj instanceof HTMLElement;
if (typeof HTMLElement !== 'undefined') {
return obj instanceof HTMLElement;
}
return !!(obj.nodeType && obj.nodeName);
};
/**