Skip to content

Commit

Permalink
👷 build v2.1.1
Browse files Browse the repository at this point in the history
⬆️ ev-emitter v1.0.3
  • Loading branch information
desandro committed Jun 10, 2016
1 parent 66d22ae commit 7c37b45
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 16 deletions.
32 changes: 20 additions & 12 deletions dist/draggabilly.pkgd.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Draggabilly PACKAGED v2.1.0
* Draggabilly PACKAGED v2.1.1
* Make that shiz draggable
* http://draggabilly.desandro.com
* MIT license
Expand Down Expand Up @@ -361,7 +361,7 @@ return getSize;
});

/**
* EvEmitter v1.0.1
* EvEmitter v1.0.3
* Lil' event emitter
* MIT License
*/
Expand All @@ -370,7 +370,7 @@ return getSize;

( function( global, factory ) {
// universal module definition
/* jshint strict: false */ /* globals define, module */
/* jshint strict: false */ /* globals define, module, window */
if ( typeof define == 'function' && define.amd ) {
// AMD - RequireJS
define( 'ev-emitter/ev-emitter',factory );
Expand All @@ -382,7 +382,7 @@ return getSize;
global.EvEmitter = factory();
}

}( this, function() {
}( typeof window != 'undefined' ? window : this, function() {



Expand Down Expand Up @@ -415,8 +415,8 @@ proto.once = function( eventName, listener ) {
// set once flag
// set onceEvents hash
var onceEvents = this._onceEvents = this._onceEvents || {};
// set onceListeners array
var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || [];
// set onceListeners object
var onceListeners = onceEvents[ eventName ] = onceEvents[ eventName ] || {};
// set flag
onceListeners[ listener ] = true;

Expand Down Expand Up @@ -1060,7 +1060,7 @@ return Unidragger;
}));

/*!
* Draggabilly v2.1.0
* Draggabilly v2.1.1
* Make that shiz draggable
* http://draggabilly.desandro.com
* MIT license
Expand Down Expand Up @@ -1177,6 +1177,13 @@ proto.option = function( opts ) {
extend( this.options, opts );
};

// css position values that don't need to be set
var positionValues = {
relative: true,
absolute: true,
fixed: true
};

proto._create = function() {

// properties
Expand All @@ -1190,7 +1197,7 @@ proto._create = function() {

// set relative positioning
var style = getComputedStyle( this.element );
if ( style.position != 'relative' && style.position != 'absolute' ) {
if ( !positionValues[ style.position ] ) {
this.element.style.position = 'relative';
}

Expand Down Expand Up @@ -1236,7 +1243,7 @@ proto.dispatchEvent = function( type, event, args ) {
// -------------------------- position -------------------------- //

// get x/y position from style
Draggabilly.prototype._getPosition = function() {
proto._getPosition = function() {
var style = getComputedStyle( this.element );
var x = this._getPositionCoord( style.left, 'width' );
var y = this._getPositionCoord( style.top, 'height' );
Expand All @@ -1247,13 +1254,14 @@ Draggabilly.prototype._getPosition = function() {
this._addTransformPosition( style );
};

Draggabilly.prototype._getPositionCoord = function( styleSide, measure ) {
proto._getPositionCoord = function( styleSide, measure ) {
if ( styleSide.indexOf('%') != -1 ) {
// convert percent into pixel for Safari, #75
var parentSize = getSize( this.element.parentNode );
return ( parseFloat( styleSide ) / 100 ) * parentSize[ measure ];
// prevent not-in-DOM element throwing bug, #131
return !parentSize ? 0 :
( parseFloat( styleSide ) / 100 ) * parentSize[ measure ];
}

return parseInt( styleSide, 10 );
};

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

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion draggabilly.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*!
* Draggabilly v2.1.0
* Draggabilly v2.1.1
* Make that shiz draggable
* http://draggabilly.desandro.com
* MIT license
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "draggabilly",
"version": "2.1.0",
"version": "2.1.1",
"description": "make that shiz draggable",
"main": "draggabilly.js",
"dependencies": {
Expand Down

0 comments on commit 7c37b45

Please sign in to comment.