diff --git a/README.md b/README.md index 675da5e..67e2be6 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/gridstack.js b/src/gridstack.js index 51835a8..c61ac83 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -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) {