[Libreoffice-commits] online.git: 2 commits - loleaflet/dist loleaflet/src
Pranav Kant
pranavk at collabora.co.uk
Fri Nov 18 11:50:48 UTC 2016
loleaflet/dist/toolbar/toolbar.js | 2 ++
loleaflet/src/core/Socket.js | 4 +++-
loleaflet/src/layer/tile/TileLayer.js | 5 -----
3 files changed, 5 insertions(+), 6 deletions(-)
New commits:
commit 373e68d42c0a163e517fead747f6eb1dee58db87
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Fri Nov 18 17:13:32 2016 +0530
Set reconnection flag when reconnecting
'status' message can well be sent after document has already been
loaded. Eg: when the doc size is changed. We don't want this code
to execute in all such cases.
Change-Id: Ia69ab70edddda1a4e27618101eaff35bd0e5eb65
diff --git a/loleaflet/src/core/Socket.js b/loleaflet/src/core/Socket.js
index e9efbee..1c124fb 100644
--- a/loleaflet/src/core/Socket.js
+++ b/loleaflet/src/core/Socket.js
@@ -83,6 +83,7 @@ L.Socket = L.Class.extend({
var msg = 'load url=' + encodeURIComponent(this._map.options.doc);
if (this._map._docLayer) {
+ this._reconnecting = true;
// we are reconnecting after a lost connection
msg += ' part=' + this._map.getCurrentPartNumber();
}
@@ -359,8 +360,9 @@ L.Socket = L.Class.extend({
this._map._docLayer = docLayer;
this._map.addLayer(docLayer);
this._map.fire('doclayerinit');
- } else if (textMsg.startsWith('status:')) {
+ } else if (textMsg.startsWith('status:') && this._reconnecting) {
// we are reconnecting ...
+ this._reconecting = false;
this._map._docLayer._onMessage('invalidatetiles: EMPTY', null);
this._map.fire('statusindicator', {statusType: 'reconnected'});
this._map.setPermission(this._map.options.permission);
commit bad071760dfae423ead1222a26da812d9ff277b8
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Fri Nov 18 17:06:20 2016 +0530
Supercede a hack with a better solution + flush tiles on reconn.
This also introduced a regression where upon reconnection of the
document, tiles were not updated. This was because calling
setView leads to calling 'canceltiles' down the line which would
cancel the the 'tilecombine' request for fetching all tiles
leading to stale tiles in the UI
Change-Id: Ib0f583c92802195384ea10f328c0ba2eafc82ffd
diff --git a/loleaflet/dist/toolbar/toolbar.js b/loleaflet/dist/toolbar/toolbar.js
index 8ce0d9a..b0aedc8 100644
--- a/loleaflet/dist/toolbar/toolbar.js
+++ b/loleaflet/dist/toolbar/toolbar.js
@@ -1366,7 +1366,9 @@ function updateUserListCount() {
userlistItem.text = _('No users');
}
+ var zoomlevel = $('#zoomlevel').html();
w2ui['toolbar-down'].refresh();
+ $('#zoomlevel').html(zoomlevel);
}
map.on('addview', function(e) {
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 5e2c3a0..7d6aa7a 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -837,11 +837,6 @@ L.TileLayer = L.GridLayer.extend({
this._removeView(parseInt(viewInfoIdx));
}
}
-
- //FIXME: Ugly hack to prevent the toolbar from reseting the zoomlevel to 100%.
- var center = this._map.getCenter();
- this._map.setView(center, this._map._zoom-1, {reset: false, animate: false});
- this._map.setView(center, this._map._zoom+1, {reset: true, animate: false});
},
_onPartPageRectanglesMsg: function (textMsg) {
More information about the Libreoffice-commits
mailing list