updated dist

This commit is contained in:
vieron
2012-09-09 14:32:49 +02:00
parent b71b8727df
commit 104ee3220d
3 changed files with 23 additions and 23 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/*! gridster.js - v0.1.0 - 2012-08-20
/*! gridster.js - v0.1.0 - 2012-09-09
* http://gridster.net/
* Copyright (c) 2012 ducksboard; Licensed MIT */
+20 -20
View File
@@ -1,4 +1,4 @@
/*! gridster.js - v0.1.0 - 2012-08-20
/*! gridster.js - v0.1.0 - 2012-09-09
* http://gridster.net/
* Copyright (c) 2012 ducksboard; Licensed MIT */
@@ -285,12 +285,8 @@
fn.get_closest_colliders = function(player_data_coords){
var colliders = this.find_collisions(player_data_coords);
var min_area = 100;
colliders.sort(function(a, b){
if (a.area <= min_area) {
return 1;
}
colliders.sort(function(a, b) {
/* if colliders are being overlapped by the "C" (center) region,
* we have to set a lower index in the array to which they are placed
* above in the grid. */
@@ -302,7 +298,7 @@
}
}
if (a.area < b.area){
if (a.area < b.area) {
return 1;
}
@@ -1904,13 +1900,14 @@
/**
* Get widgets overlapping with the player.
* Get widgets overlapping with the player or with the object passed
* representing the grid cells.
*
* @method get_widgets_under_player
* @return {HTMLElement} Returns a jQuery collection of HTMLElements
*/
fn.get_widgets_under_player = function() {
var cells = this.cells_occupied_by_player || {cols: [], rows: []};
fn.get_widgets_under_player = function(cells) {
cells || (cells = this.cells_occupied_by_player || {cols: [], rows: []});
var $widgets = $([]);
$.each(cells.cols, $.proxy(function(i, col) {
@@ -1944,7 +1941,7 @@
size_x: phgd.size_x
});
//Prevents widgets go out of the grid
// Prevents widgets go out of the grid
var right_col = (col + phgd.size_x - 1);
if (right_col > this.cols) {
col = col - (right_col - col);
@@ -1971,6 +1968,16 @@
}, this));
}
var $widgets_under_ph = this.get_widgets_under_player(this.cells_occupied_by_placeholder);
if ($widgets_under_ph.length) {
$widgets_under_ph.each($.proxy(function(i, widget) {
var $w = $(widget);
this.move_widget_down(
$w, row + phgd.size_y - $w.data('coords').grid.row);
}, this));
};
};
@@ -2038,21 +2045,14 @@
var upper_rows = [];
var min_row = 10000;
if (widget_grid_data.col < this.player_grid_data.col &&
(widget_grid_data.col + widget_grid_data.size_y - 1) >
(this.player_grid_data.col + this.player_grid_data.size_y - 1)
) {
return false;
};
/* generate an array with columns as index and array with upper rows
/* generate an array with columns as index and array with topmost rows
* empty as value */
this.for_each_column_occupied(widget_grid_data, function(tcol) {
var grid_col = this.gridmap[tcol];
upper_rows[tcol] = [];
var r = p_bottom_row + 1;
// iterate over each row
while (--r > 0) {
if (this.is_widget(tcol, r) && !this.is_player_in(tcol, r)) {
if (!grid_col[r].is(widget_grid_data.el)) {
+2 -2
View File
File diff suppressed because one or more lines are too long