[Libreoffice-commits] online.git: loleaflet/src

Mihai Varga mihai.varga at collabora.com
Wed Jul 22 08:19:42 PDT 2015


 loleaflet/src/layer/tile/GridLayer.js |    8 +-------
 loleaflet/src/layer/tile/TileLayer.js |    4 ----
 2 files changed, 1 insertion(+), 11 deletions(-)

New commits:
commit 929cf9e06127312a702b3586e463b7ad7c0ec36b
Author: Mihai Varga <mihai.varga at collabora.com>
Date:   Wed Jul 22 18:17:38 2015 +0300

    loleaflet: disabled prefetching in editing mode
    
    Because the server discards requests that are already in the queue so
    we can no longer keep track of the number of requested/received tiles.
    This count was used to determine if the user is idle (not editing) so
    we can prefetch tiles in the meanwhile

diff --git a/loleaflet/src/layer/tile/GridLayer.js b/loleaflet/src/layer/tile/GridLayer.js
index 96b510c..c82490f 100644
--- a/loleaflet/src/layer/tile/GridLayer.js
+++ b/loleaflet/src/layer/tile/GridLayer.js
@@ -517,7 +517,6 @@ L.GridLayer = L.Layer.extend({
 				// we know that a new set of tiles that cover the whole view has been requested
 				// so we're able to cancel the previous requests that are being processed
 				this.sendMessage('canceltiles');
-				this._pendingTilesCount = 0;
 				for (key in this._tiles) {
 					if (!this._tiles[key].loaded) {
 						L.DomUtil.remove(this._tiles[key].el);
@@ -662,7 +661,6 @@ L.GridLayer = L.Layer.extend({
 		if (!this._tileCache[key]) {
 			if (this.options.useSocket && this._map.socket) {
 				var twips = this._coordsToTwips(coords);
-				this._pendingTilesCount += 1;
 				this.sendMessage('tile ' +
 								'part=' + coords.part + ' ' +
 								'width=' + this._tileSize + ' ' +
@@ -790,17 +788,13 @@ L.GridLayer = L.Layer.extend({
 	},
 
 	_preFetchTiles: function () {
-		if (this._pendingTilesCount > 0) {
+		if (this._permission === 'edit') {
 			return;
 		}
 		var center = this._map.getCenter();
 		var zoom = this._map.getZoom();
 		var tilesToFetch = 10;
 		var maxBorderWidth = 5;
-		if (this._permission === 'edit') {
-			tilesToFetch = 2;
-			maxBorderWidth = 2;
-		}
 
 		if (!this._preFetchBorder) {
 			var pixelBounds = this._map.getPixelBounds(center, zoom),
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 02ae828..67c9f88 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -90,7 +90,6 @@ L.TileLayer = L.GridLayer.extend({
 			}),
 			draggable: true
 		});
-		this._pendingTilesCount = 0;
 		this._textArea = L.DomUtil.get('clipboard');
 		this._textArea.focus();
 	},
@@ -392,9 +391,6 @@ L.TileLayer = L.GridLayer.extend({
 			else {
 				this._tileCache[key] = img;
 			}
-			if (this._pendingTilesCount > 0) {
-				this._pendingTilesCount -= 1;
-			}
 			L.Log.log(textMsg, L.INCOMING, key);
 		}
 		else if (textMsg.startsWith('textselection:')) {


More information about the Libreoffice-commits mailing list