Merge pull request #2 from troolee/master

Update from troolee
This commit is contained in:
cvillemure 2015-10-08 15:06:23 -04:00
commit c2b1dee5fa
7 changed files with 68 additions and 15 deletions

View file

@ -383,6 +383,8 @@
var GridStack = function(el, opts) {
var self = this, one_column_mode;
opts = opts || {};
this.container = $(el);
opts.item_class = opts.item_class || 'grid-stack-item';
@ -394,6 +396,7 @@
item_class: 'grid-stack-item',
placeholder_class: 'grid-stack-placeholder',
handle: '.grid-stack-item-content',
handle_class: null,
cell_height: 60,
vertical_margin: 20,
auto: true,
@ -408,7 +411,7 @@
handles: 'se'
}),
draggable: _.defaults(opts.draggable || {}, {
handle: '.grid-stack-item-content',
handle: (opts.handle_class ? '.' + opts.handle_class : (opts.handle ? opts.handle : '')) || '.grid-stack-item-content',
scroll: false,
appendTo: 'body'
})
@ -446,7 +449,7 @@
if (this.opts.auto) {
var elements = [];
var _this = this;
this.container.children('.' + this.opts.item_class).each(function(index, el) {
this.container.children('.' + this.opts.item_class + ':not(.' + this.opts.placeholder_class + ')').each(function(index, el) {
el = $(el);
elements.push({
el: el,
@ -514,7 +517,7 @@
$(window).resize(this.on_resize_handler);
this.on_resize_handler();
};
GridStack.prototype._trigger_change_event = function(forceTrigger) {
var elements = this.grid.get_dirty_nodes();
var hasChanges = false;
@ -758,7 +761,7 @@
this.container.remove();
Utils.remove_stylesheet(this._styles_id);
if (this.grid)
this.grid = null;
this.grid = null;
};
GridStack.prototype.resizable = function(el, val) {
@ -956,7 +959,7 @@
GridStack.prototype._set_static_class = function() {
var static_class_name = 'grid-stack-static';
if (this.opts.static_grid === true) {
this.container.addClass(static_class_name);
} else {