Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

IE8 does not support instanceof. #39

Merged
merged 1 commit into from

2 participants

@mshafrir

Fall back to comparing nodeType value against Node.ELEMENT_NODE (see https://developer.mozilla.org/en/nodeType)

@ChiperSoft ChiperSoft merged commit fb28c65 into from
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/main.js
View
9 src/main.js
@@ -2,7 +2,14 @@ var today;
var Kalendae = function (targetElement, options) {
//if the first argument isn't an element and isn't a string, assume that it is the options object
- if (!(targetElement instanceof Element || typeof targetElement === 'string')) options = targetElement;
+ var is_element = false;
+ try {
+ is_element = targetElement instanceof Element;
+ }
+ catch (err) {
+ is_element = !!targetElement && is_element.nodeType === 1;
+ }
+ if (!(is_element || typeof(targetElement) === 'string')) options = targetElement;
var self = this,
classes = self.classes,
Something went wrong with that request. Please try again.