add handle_class option
This commit is contained in:
parent
91e9d6fb77
commit
79f509c6e6
5 changed files with 11 additions and 4 deletions
|
|
@ -132,6 +132,7 @@ $(function () {
|
|||
- `cell_height` - one cell height (default: `60`)
|
||||
- `draggable` - allows to override jQuery UI draggable options. (default: `{handle: '.grid-stack-item-content', scroll: true, appendTo: 'body'}`)
|
||||
- `handle` - draggable handle selector (default: `'.grid-stack-item-content'`)
|
||||
- `handle_class` - draggable handle class (e.g. `'grid-stack-item-content'`). If set `handle` is ignored (default: `null`)
|
||||
- `height` - maximum rows amount. Default is `0` which means no maximum rows
|
||||
- `float` - enable floating widgets (default: `false`) See [example](http://troolee.github.io/gridstack.js/demo/float.html)
|
||||
- `item_class` - widget class (default: `'grid-stack-item'`)
|
||||
|
|
|
|||
5
dist/gridstack.js
vendored
5
dist/gridstack.js
vendored
|
|
@ -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 ? '.' + opts.handle : '') || '.grid-stack-item-content',
|
||||
scroll: false,
|
||||
appendTo: 'body'
|
||||
})
|
||||
|
|
|
|||
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
|
|
@ -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 ? '.' + opts.handle : '') || '.grid-stack-item-content',
|
||||
scroll: false,
|
||||
appendTo: 'body'
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue