[Libreoffice-commits] online.git: loleaflet/src
Pranav Kant
pranavk at collabora.co.uk
Fri Feb 2 09:13:55 UTC 2018
loleaflet/src/layer/tile/CalcTileLayer.js | 5 +----
loleaflet/src/layer/tile/ImpressTileLayer.js | 6 ++++++
loleaflet/src/layer/tile/TileLayer.js | 4 ++++
loleaflet/src/layer/tile/WriterTileLayer.js | 7 +++++++
loleaflet/src/map/Map.js | 3 +++
5 files changed, 21 insertions(+), 4 deletions(-)
New commits:
commit 39772015a1eaf05b19706e28bc863fe569d228ad
Author: Pranav Kant <pranavk at collabora.co.uk>
Date: Fri Feb 2 14:42:44 2018 +0530
loleaflet: Remove comments, changes on doc disconnect
Change-Id: Iccad2afe8a8ddf85fd83577c1d1b822724ce318a
diff --git a/loleaflet/src/layer/tile/CalcTileLayer.js b/loleaflet/src/layer/tile/CalcTileLayer.js
index 2cbeb06c..4adc1420 100644
--- a/loleaflet/src/layer/tile/CalcTileLayer.js
+++ b/loleaflet/src/layer/tile/CalcTileLayer.js
@@ -48,9 +48,7 @@ L.CalcTileLayer = L.TileLayer.extend({
clearAnnotations: function () {
for (var tab in this._annotations) {
- for (var key in this._annotations[tab]) {
- this.hideAnnotation(this._annotations[tab][key]);
- }
+ this.hideAnnotations(tab);
}
this._annotations = {};
},
@@ -99,7 +97,6 @@ L.CalcTileLayer = L.TileLayer.extend({
},
hideAnnotations: function (part) {
-
var annotations = this._annotations[part];
for (var key in annotations) {
this.hideAnnotation(annotations[key]);
diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index abad6a79..1036067d 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -41,6 +41,12 @@ L.ImpressTileLayer = L.TileLayer.extend({
return null;
},
+ clearAnnotations: function() {
+ for (var part in this._partHashes) {
+ this.hideAnnotations(part);
+ }
+ },
+
hideAnnotations: function (part) {
this._selectedAnnotation = undefined;
var annotations = this._annotations[this._partHashes[part]];
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index 0046421b..1494fe88 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -298,6 +298,10 @@ L.TileLayer = L.GridLayer.extend({
map.fire('statusindicator', {statusType: 'loleafletloaded'});
},
+ clearAnnotations: function() {
+ console.debug('Implemented in child classes');
+ },
+
getEvents: function () {
var events = {
viewreset: this._viewReset,
diff --git a/loleaflet/src/layer/tile/WriterTileLayer.js b/loleaflet/src/layer/tile/WriterTileLayer.js
index b88b60b8..6c1a886b 100644
--- a/loleaflet/src/layer/tile/WriterTileLayer.js
+++ b/loleaflet/src/layer/tile/WriterTileLayer.js
@@ -16,6 +16,13 @@ L.WriterTileLayer = L.TileLayer.extend({
}
},
+ clearAnnotations: function() {
+ if (this._annotations) {
+ this._annotations.clear();
+ this._annotations.clearChanges();
+ }
+ },
+
onRemove: function (map) {
map.off('updatemaxbounds', this._onUpdateMaxBounds, this);
},
diff --git a/loleaflet/src/map/Map.js b/loleaflet/src/map/Map.js
index 6c761b98..17d033cc 100644
--- a/loleaflet/src/map/Map.js
+++ b/loleaflet/src/map/Map.js
@@ -166,6 +166,9 @@ L.Map = L.Evented.extend({
} else {
this._activate();
}
+ } else {
+ // remove the comments and changes
+ this._docLayer.clearAnnotations();
}
}, this);
},
More information about the Libreoffice-commits
mailing list