updated docs and diet

This commit is contained in:
vieron
2012-07-20 11:06:26 +02:00
parent 0e03a05435
commit 7624182bf4
9 changed files with 138 additions and 129 deletions

View File

@@ -1,4 +1,4 @@
/*! gridster.js - v0.1.0 - 2012-07-19
/*! gridster.js - v0.1.0 - 2012-07-20
* https://github.com/ducksboard/gridster.js
* Copyright (c) 2012 ducksboard; Licensed MIT, GPL */
@@ -484,8 +484,8 @@
}
if (valid_pos.length) {
var next_position = this.sort_by_row_asc(valid_pos);
next_position = this.sort_by_row_asc(next_position)[0];
var next_position = this.sort_by_row_desc(valid_pos);
next_position = this.sort_by_col_asc(next_position)[0];
return next_position;
}
return false;
@@ -652,16 +652,19 @@
$(ui.helper) : self.$player;
self.on_start_drag.call(self, event, ui);
self.$el.trigger('gridster:dragstart');
},
stop: function(event, ui) {
self.on_stop_drag.call(self, ui);
self.$el.trigger('gridster:dragstop');
},
drag: throttle(function(event, ui) {
self.on_drag.call(self, event, ui);
self.$el.trigger('gridster:drag');
}, 100, true)
});
this.$widgets.draggable(draggable_options);
this.$widgets.draggable(draggable_options);
return this;
};
@@ -1117,7 +1120,8 @@
* @return {Boolean} Returns true or false.
*/
fn.is_placeholder_in_col = function(col) {
return $.inArray(col, this.cells_occupied_by_placeholder.cols) >= 0;
var c = this.cells_occupied_by_placeholder || [];
return $.inArray(col, c.cols) >= 0;
};
@@ -1866,12 +1870,11 @@
col: col,
row: row
};
var cells_occupied_by_w = this.get_cells_occupied(widget_grid_data);
var result = true;
this.for_each_cell_occupied(future_wd, function(tcol, trow){
var $tw = this.is_widget(tcol, trow);
if ($tw && !$tw.is($w)) {
if ($tw && (!widget_grid_data.el || $tw.is($w))) {
result = false;
}
});