From 816071a0779a28f8322ceaf4a50fde6e6c2e5c44 Mon Sep 17 00:00:00 2001 From: Martin Mrose Date: Tue, 3 Nov 2015 00:14:57 +0100 Subject: [PATCH 1/2] Triggering enable and disable events on gridstack container --- src/gridstack.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gridstack.js b/src/gridstack.js index afd784318..5f2e528f2 100644 --- a/src/gridstack.js +++ b/src/gridstack.js @@ -812,11 +812,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) { From 8c5ab67796b7629afad9e374b75a3ff91381ee97 Mon Sep 17 00:00:00 2001 From: Martin Mrose Date: Tue, 3 Nov 2015 00:20:47 +0100 Subject: [PATCH 2/2] Updated readme --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 675da5ec0..67e2be683 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