Commit 806b84a9 authored by Mario Aguilar Alves's avatar Mario Aguilar Alves

Edit grid error solution

parent aa68b025
...@@ -102,25 +102,26 @@ ...@@ -102,25 +102,26 @@
}.bind(this); }.bind(this);
this.edit_grid = function () { this.edit_grid = function () {
mode = jQuery('#edit-grid').data('mode'); mode = jQuery('#edit-grid').data('mode');
var grid = this;
if (mode == 0) { if (mode == 0) {
// enable all the grid editing // enable all the grid editing
_.map(jQuery('.grid-stack > .grid-stack-item:visible'), function (el) { _.map(jQuery('.grid-stack > .grid-stack-item:visible'), function (el) {
this.grid.movable(el, true); grid.grid.movable(el, true);
jQuery(el).on('dblclick', function (e) { jQuery(el).on('dblclick', function (e) {
this.grid.resizable(el, true); grid.grid.resizable(el, true);
}.bind(this)); }.bind(this));
}, this); }, this);
jQuery('#edit-grid').data('mode', 1).text('{{ trans('dashboard::dashboard.save grid') }}'); jQuery('#edit-grid').data('mode', 1).text('{{ trans('dashboard::dashboard.save grid') }}');
} else { } else {
// disable all the grid editing // disable all the grid editing
_.map(jQuery('.grid-stack > .grid-stack-item:visible'), function (el) { _.map(jQuery('.grid-stack > .grid-stack-item:visible'), function (el) {
this.grid.movable(el, false); grid.grid.movable(el, false);
this.grid.resizable(el, false); grid.grid.resizable(el, false);
jQuery(el).off('dblclick'); jQuery(el).off('dblclick');
}, this); }, this);
jQuery('#edit-grid').data('mode', 0).text('{{ trans('dashboard::dashboard.edit grid') }}'); jQuery('#edit-grid').data('mode', 0).text('{{ trans('dashboard::dashboard.edit grid') }}');
// run the save mech // run the save mech
this.save_grid(); grid.save_grid();
} }
}.bind(this); }.bind(this);
this.spawn_widget = function (node) { this.spawn_widget = function (node) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment