From c7dce7cf4e7740f9fddce072eeb48e9e63e1dc0e Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Sat, 21 Jun 2014 11:05:32 +1000 Subject: [PATCH] Improve row move plugin --- .../handsontable/jquery.handsontable.js | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/modules/backend/formwidgets/datagrid/assets/vendor/handsontable/jquery.handsontable.js b/modules/backend/formwidgets/datagrid/assets/vendor/handsontable/jquery.handsontable.js index af6b86557..015d1a2e8 100644 --- a/modules/backend/formwidgets/datagrid/assets/vendor/handsontable/jquery.handsontable.js +++ b/modules/backend/formwidgets/datagrid/assets/vendor/handsontable/jquery.handsontable.js @@ -3246,24 +3246,30 @@ Handsontable.TableView.prototype.scrollViewport = function (coords) { * @param TH */ Handsontable.TableView.prototype.appendRowHeader = function (row, TH) { - var DIV = document.createElement('DIV'), - SPAN = document.createElement('SPAN'); - - DIV.className = 'relative'; - SPAN.className = 'rowHeader'; if (row > -1) { + var DIV = document.createElement('DIV'), + SPAN = document.createElement('SPAN'); + + DIV.className = 'relative'; + SPAN.className = 'rowHeader'; + this.wt.wtDom.fastInnerHTML(SPAN, this.instance.getRowHeader(row)); + + DIV.appendChild(SPAN); + this.wt.wtDom.empty(TH); + + TH.appendChild(DIV); + this.instance.PluginHooks.run('afterGetRowHeader', row, TH); } else { - this.wt.wtDom.fastInnerText(SPAN, '\u00A0'); + var DIV = document.createElement('DIV'); + DIV.className = 'relative'; + this.wt.wtDom.fastInnerText(DIV, '\u00A0'); + this.wt.wtDom.empty(TH); + TH.appendChild(DIV); } - DIV.appendChild(SPAN); - this.wt.wtDom.empty(TH); - - TH.appendChild(DIV); - this.instance.PluginHooks.run('afterGetRowHeader', row, TH); }; /**