[Libreoffice-commits] online.git: loleaflet/dist loleaflet/src
Pranav Kant
pranavk at collabora.co.uk
Thu Jan 12 13:41:35 UTC 2017
loleaflet/dist/toolbar/toolbar.js | 4 ++++
loleaflet/src/control/Toolbar.js | 6 +++++-
2 files changed, 9 insertions(+), 1 deletion(-)
New commits:
commit 8afcc582bef39630b6e899bbd79b3f5ca7c348d6
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Thu Jan 12 19:10:12 2017 +0530
loleaflet: Avoid a race condition
There was a race condition here between our toolbar doing its
stuff and loolwsd sending us websocket messages, noticeable on
slow networks.
Change-Id: I5ae174e94561dd427d22389e443c80b2a6be4ec4
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index b299611..8f15678 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -1343,6 +1343,10 @@ function updateCommandValues() {
}
}
+map.on('updatetoolbarcommandvalues', function(e) {
+ w2ui['toolbar-up'].refresh();
+});
+
map.on('updateparts pagenumberchanged', function (e) {
if (e.docType === 'text') {
var current = e.currentPage;
diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js
index 466d698..8d229f5 100644
--- a/loleaflet/src/control/Toolbar.js
+++ b/loleaflet/src/control/Toolbar.js
@@ -44,7 +44,11 @@ L.Map.include({
},
getToolbarCommandValues: function (command) {
- return this._docLayer._toolbarCommandValues[command];
+ if (this._docLayer) {
+ return this._docLayer._toolbarCommandValues[command];
+ }
+
+ return undefined;
},
downloadAs: function (name, format, options, id) {
More information about the Libreoffice-commits
mailing list