diff --git a/README.md b/README.md index 7050b4e..fe8aca5 100644 --- a/README.md +++ b/README.md @@ -66,4 +66,8 @@ Called before draggable.stop event. The default is $.noop. _(Coming soon)_ ## Release History -_(Nothing yet)_ +_0.1.0_ inital release +_0.1.1_ fix +https://github.com/javadoug/jquery.drag-multiple/issues/3 +https://github.com/javadoug/jquery.drag-multiple/issues/2 + diff --git a/dist/jquery-ui.drag-multiple.js b/dist/jquery-ui.drag-multiple.js index e89a0b1..9005427 100644 --- a/dist/jquery-ui.drag-multiple.js +++ b/dist/jquery-ui.drag-multiple.js @@ -1,6 +1,6 @@ -/*! Drag Multiple Plugin - v0.1.0 - 2013-09-17 +/*! Drag Multiple Plugin - v0.1.1 - 2014-05-14 * https://github.com/javadoug/jquery.drag-multiple -* Copyright (c) 2013 Doug Ross; Licensed MIT */ +* Copyright (c) 2014 Doug Ross; Licensed MIT */ /*globals jQuery */ (function ($) { @@ -68,7 +68,7 @@ element = this; // the draggable instance - instance = element.data('draggable'); + instance = element.data('draggable') || element.data('ui-draggable'); // initialize state instance.multiple = {}; @@ -104,7 +104,7 @@ var element, instance, options; element = this; - instance = element.data('draggable'); + instance = element.data('draggable') || element.data('ui-draggable'); options = instance.multiple.options; if (options.dragCanceled) { @@ -136,7 +136,7 @@ var element, instance, options; element = this; - instance = element.data('draggable'); + instance = element.data('draggable') || element.data('ui-draggable'); options = instance.multiple.options; if (options.dragCanceled) { diff --git a/dist/jquery-ui.drag-multiple.min.js b/dist/jquery-ui.drag-multiple.min.js index e54e044..050cf84 100644 --- a/dist/jquery-ui.drag-multiple.min.js +++ b/dist/jquery-ui.drag-multiple.min.js @@ -1,4 +1,4 @@ -/*! Drag Multiple Plugin - v0.1.0 - 2013-09-17 +/*! Drag Multiple Plugin - v0.1.1 - 2014-05-14 * https://github.com/javadoug/jquery.drag-multiple -* Copyright (c) 2013 Doug Ross; Licensed MIT */ -!function(a){"use strict";function b(){return!1}function c(b){return a.extend({},h,b.options.multiple)}function d(b,c,d,e){return a.isFunction(b)?b.call(c,d,e):void 0}function e(a,b,c,e){return d(b.beforeStart,a,c,e)}function f(a,b,c,e){return d(b.beforeDrag,a,c,e)}function g(a,b,c,e){return d(b.beforeStop,a,c,e)}var h={items:function(){return a(".ui-draggable.ui-selected")},beforeStart:function(){return this.is(".ui-draggable")&&this.is(".ui-selected")?void 0:(a(".ui-draggable").removeClass("ui-selected"),!1)},beforeDrag:a.noop,beforeStop:a.noop};a.ui.plugin.add("draggable","multiple",{start:function(d,f){var g,h,i,j;return g=this,h=g.data("draggable"),h.multiple={},j=h.multiple.options=c(h),i=j.items(),!1===e(g,j,d,f)?(j.dragCanceled=!0,!1):(i.each(function(){var b=a(this).position();a(this).data("dragmultiple:originalPosition",a.extend({},b))}),h.originalRevert=j.revert=h.options.revert,h.options.revert=b,void 0)},drag:function(c,d){var e,g,h;return e=this,g=e.data("draggable"),h=g.multiple.options,h.dragCanceled?!1:(f(e,h,c,d),b!==g.options.revert&&(h.revert=g.options.revert,g.options.revert=b),h.items().each(function(){var b=a(this).data("dragmultiple:originalPosition");a(this).css({top:b.top+(d.position.top-d.originalPosition.top),left:b.left+(d.position.left-d.originalPosition.left)})}),void 0)},stop:function(b,c){var d,e,f;return d=this,e=d.data("draggable"),f=e.multiple.options,f.dragCanceled?!1:(g(d,f,b,c),f.revert===!0&&f.items().each(function(){var b=a(this).data("dragmultiple:originalPosition");a(this).css(b)}),f.items().each(function(){a(this).removeData("dragmultiple:originalPosition")}),e.options.revert=e.originalRevert,void 0)}})}(jQuery); \ No newline at end of file +* Copyright (c) 2014 Doug Ross; Licensed MIT */ +!function(a){"use strict";function b(){return!1}function c(b){return a.extend({},h,b.options.multiple)}function d(b,c,d,e){return a.isFunction(b)?b.call(c,d,e):void 0}function e(a,b,c,e){return d(b.beforeStart,a,c,e)}function f(a,b,c,e){return d(b.beforeDrag,a,c,e)}function g(a,b,c,e){return d(b.beforeStop,a,c,e)}var h={items:function(){return a(".ui-draggable.ui-selected")},beforeStart:function(){return this.is(".ui-draggable")&&this.is(".ui-selected")?void 0:(a(".ui-draggable").removeClass("ui-selected"),!1)},beforeDrag:a.noop,beforeStop:a.noop};a.ui.plugin.add("draggable","multiple",{start:function(d,f){var g,h,i,j;return g=this,h=g.data("draggable")||g.data("ui-draggable"),h.multiple={},j=h.multiple.options=c(h),i=j.items(),!1===e(g,j,d,f)?(j.dragCanceled=!0,!1):(i.each(function(){var b=a(this).position();a(this).data("dragmultiple:originalPosition",a.extend({},b))}),h.originalRevert=j.revert=h.options.revert,void(h.options.revert=b))},drag:function(c,d){var e,g,h;return e=this,g=e.data("draggable")||e.data("ui-draggable"),h=g.multiple.options,h.dragCanceled?!1:(f(e,h,c,d),b!==g.options.revert&&(h.revert=g.options.revert,g.options.revert=b),void h.items().each(function(){var b=a(this).data("dragmultiple:originalPosition");a(this).css({top:b.top+(d.position.top-d.originalPosition.top),left:b.left+(d.position.left-d.originalPosition.left)})}))},stop:function(b,c){var d,e,f;return d=this,e=d.data("draggable")||d.data("ui-draggable"),f=e.multiple.options,f.dragCanceled?!1:(g(d,f,b,c),f.revert===!0&&f.items().each(function(){var b=a(this).data("dragmultiple:originalPosition");a(this).css(b)}),f.items().each(function(){a(this).removeData("dragmultiple:originalPosition")}),void(e.options.revert=e.originalRevert))}})}(jQuery); \ No newline at end of file diff --git a/drag-multiple.jquery.json b/drag-multiple.jquery.json index 36415f2..fd8340c 100644 --- a/drag-multiple.jquery.json +++ b/drag-multiple.jquery.json @@ -2,7 +2,7 @@ "name": "drag-multiple", "title": "Drag Multiple Plugin", "description": "A jQuery UI plugin enabling the selection, drag and drop of multiple ui-draggable elements.", - "version": "0.1.0", + "version": "0.1.1", "homepage": "https://github.com/javadoug/jquery.drag-multiple", "author": { "name": "Doug Ross",