Skip to content

Commit 7c7fd5a

Browse files
committed
Merge pull request #271 from mmrose/master
Adding enable and disable events
2 parents 9237ae7 + 8c5ab67 commit 7c7fd5a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,21 @@ $('.grid-stack').on('resizestop', function (event, ui) {
214214
});
215215
```
216216

217+
### disable(event)
218+
219+
```javascipt
220+
$('.grid-stack').on('disable', function(event) {
221+
var grid = event.target;
222+
});
223+
```
224+
225+
### enable(event)
226+
227+
```javascipt
228+
$('.grid-stack').on('enable', function(event) {
229+
var grid = event.target;
230+
});
231+
```
217232

218233
## API
219234

src/gridstack.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,11 +814,13 @@
814814
GridStack.prototype.disable = function() {
815815
this.movable(this.container.children('.' + this.opts.item_class), false);
816816
this.resizable(this.container.children('.' + this.opts.item_class), false);
817+
this.container.trigger('disable');
817818
};
818819

819820
GridStack.prototype.enable = function() {
820821
this.movable(this.container.children('.' + this.opts.item_class), true);
821822
this.resizable(this.container.children('.' + this.opts.item_class), true);
823+
this.container.trigger('enable');
822824
};
823825

824826
GridStack.prototype.locked = function(el, val) {

0 commit comments

Comments
 (0)