Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

refactor isElement

  • Loading branch information...
commit 7f7282607babc7a4cd1dc4862b158be79b2e148c 1 parent 49d2885
@desandro authored
Showing with 10 additions and 8 deletions.
  1. +1 −1  component.json
  2. +9 −7 draggabilly.js
View
2  component.json
@@ -1,7 +1,7 @@
{
"name": "draggabilly",
"main": "./draggabilly.js",
- "version": "1.0.0",
+ "version": "1.0.1",
"dependencies": {
"classie": "desandro/classie",
"eventEmitter": ">=3",
View
16 draggabilly.js
@@ -1,5 +1,5 @@
/*!
- * Draggabilly v1.0.0
+ * Draggabilly v1.0.1
* Make that shiz draggable
* http://draggabilly.desandro.com
*/
@@ -41,12 +41,14 @@ var getStyle = defView && defView.getComputedStyle ?
// http://stackoverflow.com/a/384380/182183
-function isElement(o){
- return (
- typeof HTMLElement === "object" ? o instanceof HTMLElement : //DOM2
- o && typeof o === "object" && o.nodeType === 1 && typeof o.nodeName==="string"
- );
-}
+var isElement = ( typeof HTMLElement === 'object' ) ?
+ function isElementDOM2( obj ) {
+ return obj instanceof HTMLElement;
+ } :
+ function isElementQuirky( obj ) {
+ return obj && typeof obj === 'object' &&
+ obj.nodeType === 1 && typeof obj.nodeName === 'string';
+ };
// -------------------------- requestAnimationFrame -------------------------- //
Please sign in to comment.
Something went wrong with that request. Please try again.