loleaflet/dist/spreadsheet.css | 2 ++ loleaflet/src/control/Control.ColumnHeader.js | 17 ++++++++++++----- loleaflet/src/control/Control.RowHeader.js | 16 ++++++++++++---- 3 files changed, 26 insertions(+), 9 deletions(-)
New commits: commit 1de001e283a71667d2139e17b35bf2441336836a Author: Henry Castro <hcas...@collabora.com> Date: Fri Aug 12 13:50:16 2016 -0400 loleaflet: fix small column/row resize diff --git a/loleaflet/dist/spreadsheet.css b/loleaflet/dist/spreadsheet.css index 7927b23..30c992c 100644 --- a/loleaflet/dist/spreadsheet.css +++ b/loleaflet/dist/spreadsheet.css @@ -105,6 +105,7 @@ padding-top: 1px; margin: 0px; height: 100%; + overflow: hidden; } .spreadsheet-header-column:hover { @@ -138,6 +139,7 @@ margin: 0px; height: 100%; cursor: pointer; + overflow: hidden; } .spreadsheet-header-row:hover { diff --git a/loleaflet/src/control/Control.ColumnHeader.js b/loleaflet/src/control/Control.ColumnHeader.js index a4cb870..b38ea32 100644 --- a/loleaflet/src/control/Control.ColumnHeader.js +++ b/loleaflet/src/control/Control.ColumnHeader.js @@ -105,22 +105,29 @@ L.Control.ColumnHeader = L.Control.Header.extend({ column = L.DomUtil.create('div', 'spreadsheet-header-column', this._columns); text = L.DomUtil.create('div', 'spreadsheet-header-column-text', column); resize = L.DomUtil.create('div', 'spreadsheet-header-column-resize', column); - resize.column = iterator + 1; - resize.width = width; var content = columns[iterator].text; text.setAttribute('rel', 'spreadsheet-column-' + content); // for easy addressing text.innerHTML = content; width = Math.round(converter.call(context, twip).x) - 1; if (width === -1) { L.DomUtil.setStyle(column, 'display', 'none'); - } - else { + } else if (width < 10) { + text.column = iterator + 1; + text.width = width; + L.DomUtil.setStyle(column, 'width', width + 'px'); + L.DomUtil.setStyle(column, 'cursor', 'col-resize'); + L.DomUtil.setStyle(text, 'cursor', 'col-resize'); + L.DomUtil.setStyle(resize, 'display', 'none'); + this.mouseInit(text); + } else { + resize.column = iterator + 1; + resize.width = width; L.DomUtil.setStyle(column, 'width', width + 'px'); L.DomUtil.setStyle(text, 'width', width - 3 + 'px'); L.DomUtil.setStyle(resize, 'width', '3px'); + this.mouseInit(resize); } L.DomEvent.addListener(text, 'click', this._onColumnHeaderClick, this); - this.mouseInit(resize); } }, diff --git a/loleaflet/src/control/Control.RowHeader.js b/loleaflet/src/control/Control.RowHeader.js index 658f156..119c020 100644 --- a/loleaflet/src/control/Control.RowHeader.js +++ b/loleaflet/src/control/Control.RowHeader.js @@ -103,23 +103,31 @@ L.Control.RowHeader = L.Control.Header.extend({ row = L.DomUtil.create('div', 'spreadsheet-header-row', this._rows); text = L.DomUtil.create('div', 'spreadsheet-header-row-text', row); resize = L.DomUtil.create('div', 'spreadsheet-header-row-resize', row); - resize.row = iterator + 1; - resize.height = height; var content = rows[iterator].text; text.setAttribute('rel', 'spreadsheet-row-' + content); // for easy addressing text.innerHTML = content; height = Math.round(converter.call(context, twip).y) - 1; if (height === -1) { L.DomUtil.setStyle(row, 'display', 'none'); + } else if (height < 10) { + text.row = iterator + 1; + text.height = height; + L.DomUtil.setStyle(row, 'height', height + 'px'); + L.DomUtil.setStyle(row, 'cursor', 'row-resize'); + L.DomUtil.setStyle(text, 'line-height', height + 'px'); + L.DomUtil.setStyle(text, 'cursor', 'row-resize'); + L.DomUtil.setStyle(resize, 'display', 'none'); + this.mouseInit(text); } else { + resize.row = iterator + 1; + resize.height = height; L.DomUtil.setStyle(row, 'height', height + 'px'); L.DomUtil.setStyle(text, 'line-height', height + 'px'); L.DomUtil.setStyle(text, 'height', height - 3 + 'px'); L.DomUtil.setStyle(resize, 'height', '3px'); + this.mouseInit(resize); } - L.DomEvent.addListener(text, 'click', this._onRowHeaderClick, this); - this.mouseInit(resize); } }, _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits