Skip to content

Commit

Permalink
Recommitting 0.5.8 stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Lu committed Aug 25, 2016
1 parent 3140374 commit f678223
Show file tree
Hide file tree
Showing 11 changed files with 70 additions and 45 deletions.
14 changes: 14 additions & 0 deletions .bower.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"name": "gridster.js",
"homepage": "https://github.com/iQmetrix/gridster.js",
"version": "0.5.8",
"_release": "0.5.8",
"_resolution": {
"type": "version",
"tag": "v0.5.8",
"commit": "bd9c95f946df2aa38c325f0c6d87af7ec52de763"
},
"_source": "[email protected]:iQmetrix/gridster.js.git",
"_target": "0.5.8",
"_originalSource": "[email protected]:iQmetrix/gridster.js.git"
}
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.8"></a>
### v0.5.8 (2015-04-16)
jquery.draggable now takes a "window" option that specifies the scrollable div in the application if it's not "window"

<a name="v0.5.7"></a>
### v0.5.7 (2015-01-09)
losen up column calculation logic, to achieve some small screen responsiveness

<a name="v0.5.6"></a>
### v0.5.6 (2014-09-25)

Expand Down
4 changes: 2 additions & 2 deletions dist/jquery.gridster.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! gridster.js - v0.5.6 - 2014-09-25
/*! gridster.js - v0.6.0 - 2015-04-16
* http://gridster.net/
* Copyright (c) 2014 ducksboard; Licensed MIT */
* Copyright (c) 2015 ducksboard; Licensed MIT */

.gridster {
position:relative;
Expand Down
27 changes: 14 additions & 13 deletions dist/jquery.gridster.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! gridster.js - v0.5.6 - 2014-09-25
/*! gridster.js - v0.6.0 - 2015-04-16
* http://gridster.net/
* Copyright (c) 2014 ducksboard; Licensed MIT */
* Copyright (c) 2015 ducksboard; Licensed MIT */

;(function(root, factory) {

Expand Down Expand Up @@ -455,7 +455,7 @@
// stop : function(e) {}
};

var $window = $(window);
var $window;
var dir_map = { x : 'left', y : 'top' };
var isTouch = !!('ontouchstart' in window);

Expand All @@ -466,7 +466,7 @@
var idCounter = 0;
var uniqId = function() {
return ++idCounter + '';
}
};

/**
* Basic drag implementation for DOM elements inside a container.
Expand Down Expand Up @@ -500,6 +500,7 @@
function Draggable(el, options) {
this.options = $.extend({}, defaults, options);
this.$document = $(document);
$window = options.window || $(window);
this.$container = $(el);
this.$dragitems = $(this.options.items, this.$container);
this.is_dragging = false;
Expand All @@ -520,7 +521,7 @@
this.disabled = false;
this.events();

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

Expand Down Expand Up @@ -578,9 +579,9 @@
var diff_y = Math.round(mouse_actual_pos.top - this.mouse_init_pos.top);

var left = Math.round(this.el_init_offset.left +
diff_x - this.baseX + $(window).scrollLeft() - this.win_offset_x);
diff_x - this.baseX + $window.scrollLeft() - this.win_offset_x);
var top = Math.round(this.el_init_offset.top +
diff_y - this.baseY + $(window).scrollTop() - this.win_offset_y);
diff_y - this.baseY + $window.scrollTop() - this.win_offset_y);

if (this.options.limit) {
if (left > this.player_max_left) {
Expand All @@ -598,8 +599,8 @@
pointer: {
left: mouse_actual_pos.left,
top: mouse_actual_pos.top,
diff_left: diff_x + ($(window).scrollLeft() - this.win_offset_x),
diff_top: diff_y + ($(window).scrollTop() - this.win_offset_y)
diff_left: diff_x + ($window.scrollLeft() - this.win_offset_x),
diff_top: diff_y + ($window.scrollTop() - this.win_offset_y)
}
};
};
Expand Down Expand Up @@ -747,8 +748,8 @@
this.helper = false;
}

this.win_offset_y = $(window).scrollTop();
this.win_offset_x = $(window).scrollLeft();
this.win_offset_y = $window.scrollTop();
this.win_offset_x = $window.scrollLeft();
this.scroll_offset_y = 0;
this.scroll_offset_x = 0;
this.el_init_offset = this.$player.offset();
Expand Down Expand Up @@ -827,7 +828,7 @@

this.$container.off(this.ns);
this.$document.off(this.ns);
$(window).off(this.ns);
$window.off(this.ns);

$.removeData(this.$container, 'drag');
};
Expand Down Expand Up @@ -3926,7 +3927,7 @@

this.cols = Math.max(min_cols, cols, this.options.min_cols);

if (max_cols !== Infinity && max_cols >= min_cols && max_cols < this.cols) {
if (max_cols !== Infinity) {
this.cols = max_cols;
}

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.

27 changes: 14 additions & 13 deletions dist/jquery.gridster.with-extras.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! gridster.js - v0.5.6 - 2014-09-25
/*! gridster.js - v0.6.0 - 2015-04-16
* http://gridster.net/
* Copyright (c) 2014 ducksboard; Licensed MIT */
* Copyright (c) 2015 ducksboard; Licensed MIT */

;(function(root, factory) {

Expand Down Expand Up @@ -455,7 +455,7 @@
// stop : function(e) {}
};

var $window = $(window);
var $window;
var dir_map = { x : 'left', y : 'top' };
var isTouch = !!('ontouchstart' in window);

Expand All @@ -466,7 +466,7 @@
var idCounter = 0;
var uniqId = function() {
return ++idCounter + '';
}
};

/**
* Basic drag implementation for DOM elements inside a container.
Expand Down Expand Up @@ -500,6 +500,7 @@
function Draggable(el, options) {
this.options = $.extend({}, defaults, options);
this.$document = $(document);
$window = options.window || $(window);
this.$container = $(el);
this.$dragitems = $(this.options.items, this.$container);
this.is_dragging = false;
Expand All @@ -520,7 +521,7 @@
this.disabled = false;
this.events();

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

Expand Down Expand Up @@ -578,9 +579,9 @@
var diff_y = Math.round(mouse_actual_pos.top - this.mouse_init_pos.top);

var left = Math.round(this.el_init_offset.left +
diff_x - this.baseX + $(window).scrollLeft() - this.win_offset_x);
diff_x - this.baseX + $window.scrollLeft() - this.win_offset_x);
var top = Math.round(this.el_init_offset.top +
diff_y - this.baseY + $(window).scrollTop() - this.win_offset_y);
diff_y - this.baseY + $window.scrollTop() - this.win_offset_y);

if (this.options.limit) {
if (left > this.player_max_left) {
Expand All @@ -598,8 +599,8 @@
pointer: {
left: mouse_actual_pos.left,
top: mouse_actual_pos.top,
diff_left: diff_x + ($(window).scrollLeft() - this.win_offset_x),
diff_top: diff_y + ($(window).scrollTop() - this.win_offset_y)
diff_left: diff_x + ($window.scrollLeft() - this.win_offset_x),
diff_top: diff_y + ($window.scrollTop() - this.win_offset_y)
}
};
};
Expand Down Expand Up @@ -747,8 +748,8 @@
this.helper = false;
}

this.win_offset_y = $(window).scrollTop();
this.win_offset_x = $(window).scrollLeft();
this.win_offset_y = $window.scrollTop();
this.win_offset_x = $window.scrollLeft();
this.scroll_offset_y = 0;
this.scroll_offset_x = 0;
this.el_init_offset = this.$player.offset();
Expand Down Expand Up @@ -827,7 +828,7 @@

this.$container.off(this.ns);
this.$document.off(this.ns);
$(window).off(this.ns);
$window.off(this.ns);

$.removeData(this.$container, 'drag');
};
Expand Down Expand Up @@ -3926,7 +3927,7 @@

this.cols = Math.max(min_cols, cols, this.options.min_cols);

if (max_cols !== Infinity && max_cols >= min_cols && max_cols < this.cols) {
if (max_cols !== Infinity) {
this.cols = max_cols;
}

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.6",
"version": "0.5.8",
"homepage": "http://gridster.net/",
"author": {
"name": "ducksboard",
Expand Down
21 changes: 11 additions & 10 deletions src/jquery.draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
// stop : function(e) {}
};

var $window = $(window);
var $window;
var dir_map = { x : 'left', y : 'top' };
var isTouch = !!('ontouchstart' in window);

Expand All @@ -44,7 +44,7 @@
var idCounter = 0;
var uniqId = function() {
return ++idCounter + '';
}
};

/**
* Basic drag implementation for DOM elements inside a container.
Expand Down Expand Up @@ -78,6 +78,7 @@
function Draggable(el, options) {
this.options = $.extend({}, defaults, options);
this.$document = $(document);
$window = options.window || $(window);
this.$container = $(el);
this.$dragitems = $(this.options.items, this.$container);
this.is_dragging = false;
Expand All @@ -98,7 +99,7 @@
this.disabled = false;
this.events();

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

Expand Down Expand Up @@ -156,9 +157,9 @@
var diff_y = Math.round(mouse_actual_pos.top - this.mouse_init_pos.top);

var left = Math.round(this.el_init_offset.left +
diff_x - this.baseX + $(window).scrollLeft() - this.win_offset_x);
diff_x - this.baseX + $window.scrollLeft() - this.win_offset_x);
var top = Math.round(this.el_init_offset.top +
diff_y - this.baseY + $(window).scrollTop() - this.win_offset_y);
diff_y - this.baseY + $window.scrollTop() - this.win_offset_y);

if (this.options.limit) {
if (left > this.player_max_left) {
Expand All @@ -176,8 +177,8 @@
pointer: {
left: mouse_actual_pos.left,
top: mouse_actual_pos.top,
diff_left: diff_x + ($(window).scrollLeft() - this.win_offset_x),
diff_top: diff_y + ($(window).scrollTop() - this.win_offset_y)
diff_left: diff_x + ($window.scrollLeft() - this.win_offset_x),
diff_top: diff_y + ($window.scrollTop() - this.win_offset_y)
}
};
};
Expand Down Expand Up @@ -325,8 +326,8 @@
this.helper = false;
}

this.win_offset_y = $(window).scrollTop();
this.win_offset_x = $(window).scrollLeft();
this.win_offset_y = $window.scrollTop();
this.win_offset_x = $window.scrollLeft();
this.scroll_offset_y = 0;
this.scroll_offset_x = 0;
this.el_init_offset = this.$player.offset();
Expand Down Expand Up @@ -405,7 +406,7 @@

this.$container.off(this.ns);
this.$document.off(this.ns);
$(window).off(this.ns);
$window.off(this.ns);

$.removeData(this.$container, 'drag');
};
Expand Down
2 changes: 1 addition & 1 deletion src/jquery.gridster.js
Original file line number Diff line number Diff line change
Expand Up @@ -3079,7 +3079,7 @@

this.cols = Math.max(min_cols, cols, this.options.min_cols);

if (max_cols !== Infinity && max_cols >= min_cols && max_cols < this.cols) {
if (max_cols !== Infinity) {
this.cols = max_cols;
}

Expand Down

0 comments on commit f678223

Please sign in to comment.