Skip to content

Commit

Permalink
🐶 v1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
desandro committed Oct 23, 2019
1 parent 0711558 commit 74e2861
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
38 changes: 22 additions & 16 deletions dist/zdog.dist.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Zdog v1.1.0
* Zdog v1.1.1
* Round, flat, designer-friendly pseudo-3D engine
* Licensed MIT
* https://zzz.dog
Expand Down Expand Up @@ -641,30 +641,34 @@ return Anchor;
// module definition
if ( typeof module == 'object' && module.exports ) {
// CommonJS
module.exports = factory( root );
module.exports = factory();
} else {
// browser global
root.Zdog.Dragger = factory( root );
root.Zdog.Dragger = factory();
}
}( this, function factory( window ) {
}( this, function factory() {

// quick & dirty drag event stuff
// messes up if multiple pointers/touches

// check for browser window #85
var hasWindow = typeof window != 'undefined';
// event support, default to mouse events
var downEvent = 'mousedown';
var moveEvent = 'mousemove';
var upEvent = 'mouseup';
if ( window.PointerEvent ) {
// PointerEvent, Chrome
downEvent = 'pointerdown';
moveEvent = 'pointermove';
upEvent = 'pointerup';
} else if ( 'ontouchstart' in window ) {
// Touch Events, iOS Safari
downEvent = 'touchstart';
moveEvent = 'touchmove';
upEvent = 'touchend';
if ( hasWindow ) {
if ( window.PointerEvent ) {
// PointerEvent, Chrome
downEvent = 'pointerdown';
moveEvent = 'pointermove';
upEvent = 'pointerup';
} else if ( 'ontouchstart' in window ) {
// Touch Events, iOS Safari
downEvent = 'touchstart';
moveEvent = 'touchmove';
upEvent = 'touchend';
}
}

function noop() {}
Expand Down Expand Up @@ -719,8 +723,10 @@ Dragger.prototype.dragStart = function( event, pointer ) {
event.preventDefault();
this.dragStartX = pointer.pageX;
this.dragStartY = pointer.pageY;
window.addEventListener( moveEvent, this );
window.addEventListener( upEvent, this );
if ( hasWindow ) {
window.addEventListener( moveEvent, this );
window.addEventListener( upEvent, this );
}
this.onDragStart( pointer );
};

Expand Down
4 changes: 2 additions & 2 deletions dist/zdog.dist.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/boilerplate.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Zdog v1.1.0
* Zdog v1.1.1
* Round, flat, designer-friendly pseudo-3D engine
* Licensed MIT
* https://zzz.dog
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zdog",
"version": "1.1.0",
"version": "1.1.1",
"description": "Round, flat, designer-friendly pseudo-3D engine",
"main": "js/index.js",
"unpkg": "dist/zdog.dist.min.js",
Expand Down

0 comments on commit 74e2861

Please sign in to comment.