update gridstack with the latest version
This commit is contained in:
parent
a5e3484ed3
commit
11a66feceb
1 changed files with 18 additions and 1 deletions
19
gridstack.js
19
gridstack.js
|
|
@ -446,6 +446,10 @@
|
|||
var css;
|
||||
css = '.' + this.opts._class + ' .' + this.opts.item_class + '[data-gs-height="' + (i + 1) + '"] { height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px; }';
|
||||
this._styles.insertRule(css, i);
|
||||
css = '.' + this.opts._class + ' .' + this.opts.item_class + '[data-gs-min-height="' + (i + 1) + '"] { min-height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px; }';
|
||||
this._styles.insertRule(css, i);
|
||||
css = '.' + this.opts._class + ' .' + this.opts.item_class + '[data-gs-max-height="' + (i + 1) + '"] { max-height: ' + (this.opts.cell_height * (i + 1) + this.opts.vertical_margin * i) + 'px; }';
|
||||
this._styles.insertRule(css, i);
|
||||
css = '.' + this.opts._class + ' .' + this.opts.item_class + '[data-gs-y="' + (i) + '"] { top: ' + (this.opts.cell_height * i + this.opts.vertical_margin * i) + 'px; }';
|
||||
this._styles.insertRule(css, i);
|
||||
}
|
||||
|
|
@ -582,6 +586,8 @@
|
|||
this.container.append(el);
|
||||
this._prepare_element(el);
|
||||
this._update_container_height();
|
||||
|
||||
return el;
|
||||
};
|
||||
|
||||
GridStack.prototype.will_it_fit = function (x, y, width, height, auto_position) {
|
||||
|
|
@ -724,6 +730,17 @@
|
|||
return Math.ceil(o.outerWidth() / o.attr('data-gs-width'));
|
||||
};
|
||||
|
||||
GridStack.prototype.get_cell_from_pixel = function(position) {
|
||||
var containerPos = this.container.position();
|
||||
var relativeLeft = position.left - containerPos.left;
|
||||
var relativeTop = position.top - containerPos.top;
|
||||
|
||||
var column_width = Math.floor(this.container.width() / this.opts.width);
|
||||
var row_height = this.opts.cell_height + this.opts.vertical_margin;
|
||||
|
||||
return {x: Math.floor(relativeLeft / column_width), y: Math.floor(relativeTop / row_height)};
|
||||
};
|
||||
|
||||
scope.GridStackUI = GridStack;
|
||||
|
||||
scope.GridStackUI.Utils = Utils;
|
||||
|
|
@ -737,4 +754,4 @@
|
|||
};
|
||||
|
||||
return scope.GridStackUI;
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue