From 5854f4ea43b2e82a3eeb40f999914babe7f84b2b Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Fri, 26 Jan 2018 11:02:37 +0300 Subject: [PATCH] [DE] Distribute table rows and columns. --- apps/documenteditor/main/app/view/DocumentHolder.js | 8 ++++---- apps/documenteditor/main/app/view/TableSettings.js | 6 ++++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/view/DocumentHolder.js b/apps/documenteditor/main/app/view/DocumentHolder.js index 6a4eaaf56..d350081c0 100644 --- a/apps/documenteditor/main/app/view/DocumentHolder.js +++ b/apps/documenteditor/main/app/view/DocumentHolder.js @@ -2578,16 +2578,16 @@ define([ var menuTableDistRows = new Common.UI.MenuItem({ caption : me.textDistributeRows }).on('click', _.bind(function(){ - // if (me.api) - // me.api.distributeCols(); + if (me.api) + me.api.asc_DistributeTableCells(false); me.fireEvent('editcomplete', me); }, me)); var menuTableDistCols = new Common.UI.MenuItem({ caption : me.textDistributeCols }).on('click', _.bind(function(){ - // if (me.api) - // me.api.distributeCols(); + if (me.api) + me.api.asc_DistributeTableCells(true); me.fireEvent('editcomplete', me); }, me)); diff --git a/apps/documenteditor/main/app/view/TableSettings.js b/apps/documenteditor/main/app/view/TableSettings.js index 4f0d26c39..ad72179a5 100644 --- a/apps/documenteditor/main/app/view/TableSettings.js +++ b/apps/documenteditor/main/app/view/TableSettings.js @@ -401,14 +401,16 @@ define([ el: $('#table-btn-distrub-rows') }); this.lockedControls.push(this.btnDistributeRows); - this.btnDistributeRows.on('click', _.bind(function(field, newValue, oldValue, eOpts){ + this.btnDistributeRows.on('click', _.bind(function(btn){ + this.api.asc_DistributeTableCells(false); }, this)); this.btnDistributeCols = new Common.UI.Button({ el: $('#table-btn-distrub-cols') }); this.lockedControls.push(this.btnDistributeCols); - this.btnDistributeCols.on('click', _.bind(function(field, newValue, oldValue, eOpts){ + this.btnDistributeCols.on('click', _.bind(function(btn){ + this.api.asc_DistributeTableCells(true); }, this)); this.linkAdvanced = $('#table-advanced-link');