add static_grid
option
This commit is contained in:
parent
c162173e87
commit
0a58260563
|
@ -129,6 +129,7 @@ $(function () {
|
|||
- `min_width` - minimal width. If window width is less, grid will be shown in one-column mode (default: `768`)
|
||||
- `placeholder_class` - class for placeholder (default: `'grid-stack-placeholder'`)
|
||||
- `resizable` - allows to override jQuery UI resizable options. (default: `{autoHide: true, handles: 'se'}`)
|
||||
- `static_grid` - makes grid static (default `false`). If true widgets are not movable/resizable. You don't even need jQueryUI draggable/resizable.
|
||||
- `vertical_margin` - vertical gap size (default: `20`)
|
||||
- `width` - amount of columns (default: `12`)
|
||||
|
||||
|
@ -669,6 +670,7 @@ Changes
|
|||
#### v0.2.4 (development version)
|
||||
|
||||
- fix closure compiler/linter warnings
|
||||
- add `static_grid` option.
|
||||
|
||||
#### v0.2.3 (2015-06-23)
|
||||
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
<script type="text/javascript">
|
||||
$(function () {
|
||||
var options = {
|
||||
static_grid: true
|
||||
};
|
||||
$('.grid-stack').gridstack(options);
|
||||
|
||||
|
|
12
dist/gridstack.js
vendored
12
dist/gridstack.js
vendored
|
@ -397,6 +397,7 @@
|
|||
auto: true,
|
||||
min_width: 768,
|
||||
float: false,
|
||||
static_grid: false,
|
||||
_class: 'grid-stack-' + (Math.random() * 10000).toFixed(0),
|
||||
animate: Boolean(this.container.attr('data-gs-animate')) || false,
|
||||
always_show_resize_handle: opts.always_show_resize_handle || false,
|
||||
|
@ -473,6 +474,9 @@
|
|||
_.each(self.grid.nodes, function(node) {
|
||||
self.container.append(node.el);
|
||||
|
||||
if (self.opts.static_grid) {
|
||||
return;
|
||||
}
|
||||
if (!node.no_move) {
|
||||
node.el.draggable('disable');
|
||||
}
|
||||
|
@ -487,6 +491,10 @@
|
|||
|
||||
one_column_mode = false;
|
||||
|
||||
if (self.opts.static_grid) {
|
||||
return;
|
||||
}
|
||||
|
||||
_.each(self.grid.nodes, function(node) {
|
||||
if (!node.no_move) {
|
||||
node.el.draggable('enable');
|
||||
|
@ -593,6 +601,10 @@
|
|||
});
|
||||
el.data('_gridstack_node', node);
|
||||
|
||||
if (self.opts.static_grid) {
|
||||
return;
|
||||
}
|
||||
|
||||
var cell_width, cell_height;
|
||||
|
||||
var on_start_moving = function(event, ui) {
|
||||
|
|
2
dist/gridstack.min.js
vendored
2
dist/gridstack.min.js
vendored
File diff suppressed because one or more lines are too long
2
dist/gridstack.min.map
vendored
2
dist/gridstack.min.map
vendored
File diff suppressed because one or more lines are too long
|
@ -397,6 +397,7 @@
|
|||
auto: true,
|
||||
min_width: 768,
|
||||
float: false,
|
||||
static_grid: false,
|
||||
_class: 'grid-stack-' + (Math.random() * 10000).toFixed(0),
|
||||
animate: Boolean(this.container.attr('data-gs-animate')) || false,
|
||||
always_show_resize_handle: opts.always_show_resize_handle || false,
|
||||
|
@ -473,6 +474,9 @@
|
|||
_.each(self.grid.nodes, function(node) {
|
||||
self.container.append(node.el);
|
||||
|
||||
if (self.opts.static_grid) {
|
||||
return;
|
||||
}
|
||||
if (!node.no_move) {
|
||||
node.el.draggable('disable');
|
||||
}
|
||||
|
@ -487,6 +491,10 @@
|
|||
|
||||
one_column_mode = false;
|
||||
|
||||
if (self.opts.static_grid) {
|
||||
return;
|
||||
}
|
||||
|
||||
_.each(self.grid.nodes, function(node) {
|
||||
if (!node.no_move) {
|
||||
node.el.draggable('enable');
|
||||
|
@ -593,6 +601,10 @@
|
|||
});
|
||||
el.data('_gridstack_node', node);
|
||||
|
||||
if (self.opts.static_grid) {
|
||||
return;
|
||||
}
|
||||
|
||||
var cell_width, cell_height;
|
||||
|
||||
var on_start_moving = function(event, ui) {
|
||||
|
|
Loading…
Reference in a new issue