[Libreoffice-commits] online.git: loleaflet/dist
Pranav Kant
pranavk at collabora.co.uk
Tue Feb 9 10:15:11 UTC 2016
loleaflet/dist/toolbar/toolbar.js | 5 +++++
1 file changed, 5 insertions(+)
New commits:
commit 290953979d952c28d4463124621205c45b4f392b
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Mon Feb 8 23:24:31 2016 +0530
loleaflet: Disable style list box for presentations and drawing
Lets enable them only after we add support for templates/layouts
in the UI.
Change-Id: I82bc855b4313e9dc9b925473b64e498002c42700
Reviewed-on: https://gerrit.libreoffice.org/22225
Reviewed-by: Andras Timar <andras.timar at collabora.com>
Tested-by: Andras Timar <andras.timar at collabora.com>
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 8a6ac76..e3665da 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -538,6 +538,8 @@ map.on('commandstatechanged', function (e) {
var state = e.state;
var found = false;
if (commandName === '.uno:StyleApply') {
+ if (map.getDocType() === 'presentation' || map.getDocType() === 'drawing')
+ return;
// Fix 'Text Body' vs 'Text body'
$(".styles-select option").each(function () {
value = this.value;
@@ -661,12 +663,15 @@ map.on('updatetoolbarcommandvalues', function (e) {
}
if (map.getDocType() === 'text') {
data = data.concat(e.commandValues.ParagraphStyles);
+ $('.styles-select').prop('disabled', false);
}
else if (map.getDocType() === 'spreadsheet') {
data = data.concat(e.commandValues.CellStyles);
+ $('.styles-select').prop('disabled', false);
}
else if (map.getDocType() === 'presentation' || map.getDocType() === 'drawing') {
data = data.concat(e.commandValues.Default);
+ $('.styles-select').prop('disabled', true);
}
$(".styles-select").select2({
data: data,
More information about the Libreoffice-commits
mailing list