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 */

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;
}
});

View File

@@ -1,3 +1,3 @@
/*! 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 */.gridster{position:relative}.gridster>*{margin:0 auto;-webkit-transition:height .4s;-moz-transition:height .4s;-o-transition:height .4s;-ms-transition:height .4s;transition:height .4s}.gridster .gs_w{z-index:2;position:absolute;background:rgba(0,0,0,.23)}.ready .gs_w:not(.player):not(.preview-holder):not(.ui-draggable-dragging){-webkit-transition:left .3s,top .3s;-moz-transition:left .3s,top .3s;-o-transition:left .3s,top .3s}.gridster.dragging .ui-sortable-helper{z-index:9}.gridster .preview-holder{border:2px dashed #333;border-radius:5px;z-index:1;background:#FFF;position:absolute}.gridster .ui-draggable-dragging{z-index:10!important}

File diff suppressed because one or more lines are too long