Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1c99335

Browse files
committed
updated dist and docs
1 parent f2fff2d commit 1c99335

File tree

8 files changed

+155
-124
lines changed

8 files changed

+155
-124
lines changed

dist/jquery.gridster.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! gridster.js - v0.1.0 - 2012-08-08
1+
/*! gridster.js - v0.1.0 - 2012-08-13
22
* http://gridster.net/
33
* Copyright (c) 2012 ducksboard; Licensed MIT */
44

dist/jquery.gridster.js

Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*! gridster.js - v0.1.0 - 2012-08-08
1+
/*! gridster.js - v0.1.0 - 2012-08-13
22
* http://gridster.net/
33
* Copyright (c) 2012 ducksboard; Licensed MIT */
44

@@ -561,6 +561,8 @@
561561

562562
return false;
563563
});
564+
565+
return false;
564566
};
565567

566568

@@ -643,8 +645,14 @@
643645
return false;
644646
};
645647

648+
fn.on_select_start = function(e) {
649+
return false;
650+
}
651+
646652

647653
fn.enable = function(){
654+
this.$container.on('selectstart', this.on_select_start);
655+
648656
this.$container.on(pointer_events.start, this.options.items, $.proxy(
649657
this.drag_handler, this));
650658

@@ -661,6 +669,7 @@
661669
fn.disable = function(){
662670
this.$container.off(pointer_events.start);
663671
this.$body.off(pointer_events.end);
672+
this.$container.off(this.on_select_start);
664673
};
665674

666675

@@ -1526,7 +1535,6 @@
15261535
return this;
15271536
};
15281537

1529-
15301538
/**
15311539
* Determines if there is a widget in the row and col given. Or if the
15321540
* HTMLElement passed as first argument is the player.
@@ -1554,7 +1562,7 @@
15541562
* @return {Boolean} Returns true or false.
15551563
*/
15561564
fn.is_player_in = function(col, row) {
1557-
var c = this.cells_occupied_by_player;
1565+
var c = this.cells_occupied_by_player || {};
15581566
return $.inArray(col, c.cols) >= 0 && $.inArray(row, c.rows) >= 0;
15591567
};
15601568

@@ -1802,6 +1810,13 @@
18021810
var upper_rows = [];
18031811
var min_row = 10000;
18041812

1813+
if (widget_grid_data.col < this.player_grid_data.col &&
1814+
(widget_grid_data.col + widget_grid_data.size_y - 1) >
1815+
(this.player_grid_data.col + this.player_grid_data.size_y - 1)
1816+
) {
1817+
return false;
1818+
};
1819+
18051820
/* generate an array with columns as index and array with upper rows
18061821
* empty as value */
18071822
this.for_each_column_occupied(widget_grid_data, function(tcol) {
@@ -1811,17 +1826,19 @@
18111826
var r = p_bottom_row + 1;
18121827

18131828
while (--r > 0) {
1814-
if (this.is_occupied(tcol, r) && !this.is_player(tcol, r)) {
1815-
break;
1829+
if (this.is_widget(tcol, r) && !this.is_player_in(tcol, r)) {
1830+
if (!grid_col[r].is(widget_grid_data.el)) {
1831+
break;
1832+
};
18161833
}
18171834

18181835
if (!this.is_player(tcol, r) &&
1819-
!this.is_placeholder_in(tcol, r)
1820-
) {
1836+
!this.is_placeholder_in(tcol, r) &&
1837+
!this.is_player_in(tcol, r)) {
18211838
upper_rows[tcol].push(r);
1822-
}
1839+
};
18231840

1824-
if (r < min_row ) {
1841+
if (r < min_row) {
18251842
min_row = r;
18261843
}
18271844
}
@@ -1863,7 +1880,7 @@
18631880
while (++r <= p_bottom_row ) {
18641881
var common = true;
18651882
$.each(upper_rows, function(col, rows) {
1866-
if (rows && $.inArray(r, rows) === -1) {
1883+
if ($.isArray(rows) && $.inArray(r, rows) === -1) {
18671884
common = false;
18681885
}
18691886
});
@@ -1888,7 +1905,6 @@
18881905
}
18891906
}
18901907

1891-
18921908
return new_row;
18931909
};
18941910

@@ -1983,7 +1999,7 @@
19831999
* @return {HTMLElements} Returns a jQuery collection of HTMLElements.
19842000
*/
19852001
fn.on_stop_overlapping_column = function(col) {
1986-
this.set_player();
2002+
this.set_player(col, false);
19872003

19882004
var self = this;
19892005
this.for_each_widget_below(col, this.cells_occupied_by_player.rows[0],
@@ -2001,7 +2017,7 @@
20012017
* @return {HTMLElements} Returns a jQuery collection of HTMLElements.
20022018
*/
20032019
fn.on_stop_overlapping_row = function(row) {
2004-
this.set_player();
2020+
this.set_player(false, row);
20052021

20062022
var self = this;
20072023
var cols = this.cells_occupied_by_player.cols;
@@ -2047,7 +2063,6 @@
20472063
var $w = $(widget);
20482064
var wgd = $w.coords().grid;
20492065
var can_go_up = self.can_go_widget_up(wgd);
2050-
20512066
if (can_go_up && can_go_up !== wgd.row) {
20522067
self.move_widget_to($w, can_go_up);
20532068
}
@@ -2314,7 +2329,8 @@
23142329
var $w = this.is_widget(col, prev_row);
23152330
if (this.is_occupied(col, prev_row) ||
23162331
this.is_player(col, prev_row) ||
2317-
this.is_placeholder_in(col, prev_row)
2332+
this.is_placeholder_in(col, prev_row) ||
2333+
this.is_player_in(col, prev_row)
23182334
) {
23192335
result = false;
23202336
return true; //break

dist/jquery.gridster.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/jquery.gridster.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)