[Libreoffice-commits] online.git: loleaflet/css loleaflet/src
Szymon KÅos (via logerrit)
logerrit at kemper.freedesktop.org
Fri May 1 15:12:12 UTC 2020
loleaflet/css/notebookbar.css | 2 -
loleaflet/src/control/Control.NotebookbarBuilder.js | 21 +++++++++++++++++---
2 files changed, 19 insertions(+), 4 deletions(-)
New commits:
commit bffdc690f4f316394c4f1c4dac617a77cdb59f79
Author: Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Apr 24 13:09:45 2020 +0200
Commit: Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri May 1 17:11:54 2020 +0200
notebookbar: create listboxes
Change-Id: I110ac8c2218dfb16ac5279c4df8b080e8534d4ed
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/93274
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
diff --git a/loleaflet/css/notebookbar.css b/loleaflet/css/notebookbar.css
index 88bb958f7..3d79652ad 100644
--- a/loleaflet/css/notebookbar.css
+++ b/loleaflet/css/notebookbar.css
@@ -70,4 +70,4 @@
#clearFormatting.notebookbar {
height: 24px !important;
-}
+}
\ No newline at end of file
diff --git a/loleaflet/src/control/Control.NotebookbarBuilder.js b/loleaflet/src/control/Control.NotebookbarBuilder.js
index c92cb856e..e1c922f25 100644
--- a/loleaflet/src/control/Control.NotebookbarBuilder.js
+++ b/loleaflet/src/control/Control.NotebookbarBuilder.js
@@ -3,7 +3,7 @@
* L.Control.NotebookbarBuilder
*/
-/* global $ */
+/* global $ _ */
L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
_customizeOptions: function() {
@@ -12,8 +12,8 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
},
_overrideHandlers: function() {
- this._controlHandlers['combobox'] = function() { return false; };
- this._controlHandlers['listbox'] = function() { return false; };
+ this._controlHandlers['combobox'] = this._comboboxControl;
+ this._controlHandlers['listbox'] = this._comboboxControl;
this._controlHandlers['pushbutton'] = function() { return false; };
this._toolitemHandlers['.uno:XLineColor'] = function() {};
@@ -28,6 +28,21 @@ L.Control.NotebookbarBuilder = L.Control.JSDialogBuilder.extend({
this._toolitemHandlers['vnd.sun.star.findbar:FocusToFindbar'] = function() {};
},
+ _comboboxControl: function(parentContainer, data, builder) {
+ if (!data.entries || data.entries.length === 0)
+ return false;
+
+ var select = L.DomUtil.createWithId('select', data.id, parentContainer);
+ $(select).addClass(builder.options.cssClass);
+
+ $(select).select2({
+ data: data.entries.sort(function (a, b) {return a.localeCompare(b);}),
+ placeholder: _(builder._cleanText(data.text))
+ });
+
+ return false;
+ },
+
build: function(parent, data, hasVerticalParent, parentHasManyChildren) {
this._amendJSDialogData(data);
More information about the Libreoffice-commits
mailing list