[Libreoffice-commits] online.git: loleaflet/Makefile.am loleaflet/src
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 1 09:54:43 UTC 2020
loleaflet/Makefile.am | 2 ++
loleaflet/src/control/Control.Notebookbar.js | 14 +++++++++++++-
loleaflet/src/control/Control.NotebookbarBuilder.js | 17 +++++++++++++++++
3 files changed, 32 insertions(+), 1 deletion(-)
New commits:
commit 7bdf49c33d11c3cecf3cae096cdd601e1cf3b09b
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Apr 22 11:29:31 2020 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri May 1 11:54:25 2020 +0200
notebookbar: use builder to create
Change-Id: If8bbbaba66aba887587b8679f7a1ac9f5ccb4490
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93052
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/loleaflet/Makefile.am b/loleaflet/Makefile.am
index 0551a1430..84dbb54b1 100644
--- a/loleaflet/Makefile.am
+++ b/loleaflet/Makefile.am
@@ -281,6 +281,7 @@ LOLEAFLET_JS =\
src/control/Control.UIManager.js \
src/control/Control.DocumentNameInput.js \
src/control/Control.Notebookbar.js \
+ src/control/Control.NotebookbarBuilder.js \
src/control/Control.Layers.js \
src/control/Search.js \
src/control/Permission.js \
@@ -550,6 +551,7 @@ pot:
src/control/Control.UIManager.js \
src/control/Control.DocumentNameInput.js \
src/control/Control.Notebookbar.js \
+ src/control/Control.NotebookbarBuilder.js \
src/control/Ruler.js \
src/control/Signing.js \
src/control/Toolbar.js \
diff --git a/loleaflet/src/control/Control.Notebookbar.js b/loleaflet/src/control/Control.Notebookbar.js
index 33084e62a..843439c82 100644
--- a/loleaflet/src/control/Control.Notebookbar.js
+++ b/loleaflet/src/control/Control.Notebookbar.js
@@ -3,7 +3,7 @@
* L.Control.Notebookbar
*/
-/* global */
+/* global $ */
L.Control.Notebookbar = L.Control.extend({
options: {
docType: ''
@@ -11,8 +11,20 @@ L.Control.Notebookbar = L.Control.extend({
onAdd: function (map) {
this.map = map;
+
+ var homeTab = JSON.parse(this.getHomeTab());
+ var builder = new L.control.notebookbarBuilder({mobileWizard: this, map: this.map});
+ builder.build($('#toolbar-wrapper').get(0), [homeTab]);
+ },
+
+ setTabs: function(tabs) {
+ $('nav').prepend(tabs);
},
+ getHomeTab: function() {
+ return '';
+ }
+
});
L.control.notebookbar = function (options) {
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js
new file mode 100644
index 000000000..a07987c31
--- /dev/null
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -0,0 +1,17 @@
+/* -*- js-indent-level: 8 -*- */
+/*
+ * L.Control.NotebookbarBuilder
+ */
+
+/* global */
+L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
+
+ onAdd: function (map) {
+ this.map = map;
+ },
+
+});
+
+L.control.notebookbarBuilder = function (options) {
+ return new L.Control.NotebookbarBuilder(options);
+};
More information about the Libreoffice-commits
mailing list