loleaflet/reference.html | 15 +++++++++++++++ loleaflet/src/control/Control.Tabs.js | 10 +++++++--- 2 files changed, 22 insertions(+), 3 deletions(-)
New commits: commit 3cc15e88b9d50e2ec0ee3aa2a8a4624513ee315a Author: Jan Holesovsky <ke...@collabora.com> Date: Wed Jan 13 11:37:55 2016 +0100 loleaflet: Update the spreadsheet tabs after inserting a sheet. diff --git a/loleaflet/reference.html b/loleaflet/reference.html index d098fea..dfe1736 100644 --- a/loleaflet/reference.html +++ b/loleaflet/reference.html @@ -8563,6 +8563,21 @@ var unoCommands = [ }, { + uno: '.uno:Insert', + parameter: { + 'Name': { + 'type': 'string', + 'value': 'Sheet Name' + }, + 'Index': { + 'type': 'long', + 'value': 0 + } + }, + description: 'Inserts a new sheet to the spreadsheet. The "Name" parameter can be left as empty string, in that case the sheet name will be generated. The "Index" parameter means the position where it should be inserted - "1" means adding as the 1st sheet, etc. 0 is special, and means adding as the last sheet.' +}, + +{ header: 'Appearance options', }, diff --git a/loleaflet/src/control/Control.Tabs.js b/loleaflet/src/control/Control.Tabs.js index 33df796..6a3a28d 100644 --- a/loleaflet/src/control/Control.Tabs.js +++ b/loleaflet/src/control/Control.Tabs.js @@ -17,7 +17,6 @@ L.Control.Tabs = L.Control.extend({ var parts = e.parts; var selectedPart = e.selectedPart; var docType = e.docType; - var partNames = e.partNames; if (docType === 'text') { return; } @@ -31,10 +30,16 @@ L.Control.Tabs = L.Control.extend({ $('.scroll-container').mCustomScrollbar('update'); $('.scroll-container').mCustomScrollbar('scrollTo', [0, 0]); }, this), 100); + this._tabsInitialized = true; + } + if ('partNames' in e) { + while (this._tabsCont.firstChild) { + this._tabsCont.removeChild(this._tabsCont.firstChild); + } for (var i = 0; i < parts; i++) { var id = 'spreadsheet-tab' + i; var tab = L.DomUtil.create('li', '', this._tabsCont); - tab.innerHTML = partNames[i]; + tab.innerHTML = e.partNames[i]; tab.id = id; L.DomEvent .on(tab, 'click', L.DomEvent.stopPropagation) @@ -43,7 +48,6 @@ L.Control.Tabs = L.Control.extend({ .on(tab, 'click', this._refocusOnMap, this); this._spreadsheetTabs[id] = tab; } - this._tabsInitialized = true; } for (var key in this._spreadsheetTabs) { var part = parseInt(key.match(/\d+/g)[0]); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits