Skip to content

Commit

Permalink
Release v0.5.6
Browse files Browse the repository at this point in the history
  • Loading branch information
vieron committed Sep 25, 2014
1 parent 79aff38 commit 3140374
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 37 deletions.
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
<a name="v0.5.6"></a>
### v0.5.6 (2014-09-25)


#### Bug Fixes

* **draggable:** namespace events with unique ids ([79aff38c](http://github.com/ducksboard/gridster.js/commit/79aff38c60cc6ce2c0f0160bd3c6f93cb2511642))

<a name="v0.5.5"></a>
### v0.5.5 (2014-07-25)

Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.gridster.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! gridster.js - v0.5.5 - 2014-07-25
/*! gridster.js - v0.5.6 - 2014-09-25
* http://gridster.net/
* Copyright (c) 2014 ducksboard; Licensed MIT */

Expand Down
42 changes: 27 additions & 15 deletions dist/jquery.gridster.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! gridster.js - v0.5.5 - 2014-07-25
/*! gridster.js - v0.5.6 - 2014-09-25
* http://gridster.net/
* Copyright (c) 2014 ducksboard; Licensed MIT */

Expand Down Expand Up @@ -458,16 +458,16 @@
var $window = $(window);
var dir_map = { x : 'left', y : 'top' };
var isTouch = !!('ontouchstart' in window);
var pointer_events = {
start: 'touchstart.gridster-draggable mousedown.gridster-draggable',
move: 'touchmove.gridster-draggable mousemove.gridster-draggable',
end: 'touchend.gridster-draggable mouseup.gridster-draggable'
};

var capitalize = function(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
};

var idCounter = 0;
var uniqId = function() {
return ++idCounter + '';
}

/**
* Basic drag implementation for DOM elements inside a container.
* Provide start/stop/drag callbacks.
Expand Down Expand Up @@ -504,6 +504,8 @@
this.$dragitems = $(this.options.items, this.$container);
this.is_dragging = false;
this.player_min_left = 0 + this.options.offset_left;
this.id = uniqId();
this.ns = '.gridster-draggable-' + this.id;
this.init();
}

Expand All @@ -518,21 +520,31 @@
this.disabled = false;
this.events();

$(window).bind('resize.gridster-draggable',
$(window).bind(this.nsEvent('resize'),
throttle($.proxy(this.calculate_dimensions, this), 200));
};

fn.nsEvent = function(ev) {
return (ev || '') + this.ns;
};

fn.events = function() {
this.$container.on('selectstart.gridster-draggable',
this.pointer_events = {
start: this.nsEvent('touchstart') + ' ' + this.nsEvent('mousedown'),
move: this.nsEvent('touchmove') + ' ' + this.nsEvent('mousemove'),
end: this.nsEvent('touchend') + ' ' + this.nsEvent('mouseup'),
};

this.$container.on(this.nsEvent('selectstart'),
$.proxy(this.on_select_start, this));

this.$container.on(pointer_events.start, this.options.items,
this.$container.on(this.pointer_events.start, this.options.items,
$.proxy(this.drag_handler, this));

this.$document.on(pointer_events.end, $.proxy(function(e) {
this.$document.on(this.pointer_events.end, $.proxy(function(e) {
this.is_dragging = false;
if (this.disabled) { return; }
this.$document.off(pointer_events.move);
this.$document.off(this.pointer_events.move);
if (this.drag_start) {
this.on_dragstop(e);
}
Expand Down Expand Up @@ -687,7 +699,7 @@
this.mouse_init_pos = this.get_mouse_pos(e);
this.offsetY = this.mouse_init_pos.top - this.el_init_pos.top;

this.$document.on(pointer_events.move, function(mme) {
this.$document.on(this.pointer_events.move, function(mme) {
var mouse_actual_pos = self.get_mouse_pos(mme);
var diff_x = Math.abs(
mouse_actual_pos.left - self.mouse_init_pos.left);
Expand Down Expand Up @@ -813,9 +825,9 @@
fn.destroy = function() {
this.disable();

this.$container.off('.gridster-draggable');
this.$document.off('.gridster-draggable');
$(window).off('.gridster-draggable');
this.$container.off(this.ns);
this.$document.off(this.ns);
$(window).off(this.ns);

$.removeData(this.$container, 'drag');
};
Expand Down
2 changes: 1 addition & 1 deletion dist/jquery.gridster.min.css

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

4 changes: 2 additions & 2 deletions dist/jquery.gridster.min.js

Large diffs are not rendered by default.

42 changes: 27 additions & 15 deletions dist/jquery.gridster.with-extras.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! gridster.js - v0.5.5 - 2014-07-25
/*! gridster.js - v0.5.6 - 2014-09-25
* http://gridster.net/
* Copyright (c) 2014 ducksboard; Licensed MIT */

Expand Down Expand Up @@ -458,16 +458,16 @@
var $window = $(window);
var dir_map = { x : 'left', y : 'top' };
var isTouch = !!('ontouchstart' in window);
var pointer_events = {
start: 'touchstart.gridster-draggable mousedown.gridster-draggable',
move: 'touchmove.gridster-draggable mousemove.gridster-draggable',
end: 'touchend.gridster-draggable mouseup.gridster-draggable'
};

var capitalize = function(str) {
return str.charAt(0).toUpperCase() + str.slice(1);
};

var idCounter = 0;
var uniqId = function() {
return ++idCounter + '';
}

/**
* Basic drag implementation for DOM elements inside a container.
* Provide start/stop/drag callbacks.
Expand Down Expand Up @@ -504,6 +504,8 @@
this.$dragitems = $(this.options.items, this.$container);
this.is_dragging = false;
this.player_min_left = 0 + this.options.offset_left;
this.id = uniqId();
this.ns = '.gridster-draggable-' + this.id;
this.init();
}

Expand All @@ -518,21 +520,31 @@
this.disabled = false;
this.events();

$(window).bind('resize.gridster-draggable',
$(window).bind(this.nsEvent('resize'),
throttle($.proxy(this.calculate_dimensions, this), 200));
};

fn.nsEvent = function(ev) {
return (ev || '') + this.ns;
};

fn.events = function() {
this.$container.on('selectstart.gridster-draggable',
this.pointer_events = {
start: this.nsEvent('touchstart') + ' ' + this.nsEvent('mousedown'),
move: this.nsEvent('touchmove') + ' ' + this.nsEvent('mousemove'),
end: this.nsEvent('touchend') + ' ' + this.nsEvent('mouseup'),
};

this.$container.on(this.nsEvent('selectstart'),
$.proxy(this.on_select_start, this));

this.$container.on(pointer_events.start, this.options.items,
this.$container.on(this.pointer_events.start, this.options.items,
$.proxy(this.drag_handler, this));

this.$document.on(pointer_events.end, $.proxy(function(e) {
this.$document.on(this.pointer_events.end, $.proxy(function(e) {
this.is_dragging = false;
if (this.disabled) { return; }
this.$document.off(pointer_events.move);
this.$document.off(this.pointer_events.move);
if (this.drag_start) {
this.on_dragstop(e);
}
Expand Down Expand Up @@ -687,7 +699,7 @@
this.mouse_init_pos = this.get_mouse_pos(e);
this.offsetY = this.mouse_init_pos.top - this.el_init_pos.top;

this.$document.on(pointer_events.move, function(mme) {
this.$document.on(this.pointer_events.move, function(mme) {
var mouse_actual_pos = self.get_mouse_pos(mme);
var diff_x = Math.abs(
mouse_actual_pos.left - self.mouse_init_pos.left);
Expand Down Expand Up @@ -813,9 +825,9 @@
fn.destroy = function() {
this.disable();

this.$container.off('.gridster-draggable');
this.$document.off('.gridster-draggable');
$(window).off('.gridster-draggable');
this.$container.off(this.ns);
this.$document.off(this.ns);
$(window).off(this.ns);

$.removeData(this.$container, 'drag');
};
Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.gridster.with-extras.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "gridster",
"title": "gridster.js",
"description": "a drag-and-drop multi-column jQuery grid plugin",
"version": "0.5.5",
"version": "0.5.6",
"homepage": "http://gridster.net/",
"author": {
"name": "ducksboard",
Expand Down

0 comments on commit 3140374

Please sign in to comment.