Skip to content

Commit

Permalink
refactor isElement
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Apr 4, 2013
1 parent 49d2885 commit 7f72826
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
2 changes: 1 addition & 1 deletion component.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "draggabilly",
"main": "./draggabilly.js",
"version": "1.0.0",
"version": "1.0.1",
"dependencies": {
"classie": "desandro/classie",
"eventEmitter": ">=3",
Expand Down
16 changes: 9 additions & 7 deletions draggabilly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Draggabilly v1.0.0
* Draggabilly v1.0.1
* Make that shiz draggable
* http://draggabilly.desandro.com
*/
Expand Down Expand Up @@ -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 -------------------------- //

Expand Down

0 comments on commit 7f72826

Please sign in to comment.