Merge pull request #271 from mmrose/master

Adding enable and disable events
This commit is contained in:
Pavel Reznikov 2016-02-08 22:39:55 -08:00
commit 7c7fd5ae0a
2 changed files with 17 additions and 0 deletions

View file

@ -214,6 +214,21 @@ $('.grid-stack').on('resizestop', function (event, ui) {
});
```
### disable(event)
```javascipt
$('.grid-stack').on('disable', function(event) {
var grid = event.target;
});
```
### enable(event)
```javascipt
$('.grid-stack').on('enable', function(event) {
var grid = event.target;
});
```
## API

View file

@ -814,11 +814,13 @@
GridStack.prototype.disable = function() {
this.movable(this.container.children('.' + this.opts.item_class), false);
this.resizable(this.container.children('.' + this.opts.item_class), false);
this.container.trigger('disable');
};
GridStack.prototype.enable = function() {
this.movable(this.container.children('.' + this.opts.item_class), true);
this.resizable(this.container.children('.' + this.opts.item_class), true);
this.container.trigger('enable');
};
GridStack.prototype.locked = function(el, val) {