[Libreoffice-commits] online.git: loleaflet/src
Henry Castro
hcastro at collabora.com
Tue Sep 13 21:26:56 UTC 2016
loleaflet/src/control/Parts.js | 6 +++---
loleaflet/src/layer/tile/TileLayer.js | 18 +++---------------
2 files changed, 6 insertions(+), 18 deletions(-)
New commits:
commit f85e6cfad9759ec6f4f013e2a0a5ea78f40278fb
Author: Henry Castro <hcastro at collabora.com>
Date: Tue Sep 13 17:26:41 2016 -0400
loleaflet: simplify iteration view
diff --git a/loleaflet/src/control/Parts.js b/loleaflet/src/control/Parts.js
index f6c9a18..55e9dbb 100644
--- a/loleaflet/src/control/Parts.js
+++ b/loleaflet/src/control/Parts.js
@@ -31,9 +31,9 @@ L.Map.include({
docType: docLayer._docType
});
this._socket.sendMessage('setclientpart part=' + docLayer._selectedPart);
- docLayer._updateViewCursors();
- docLayer._updateCellViewCursors();
- docLayer._updateGraphicViewSelections();
+ docLayer.eachView(docLayer._viewCursors, docLayer._onUpdateViewCursor, docLayer);
+ docLayer.eachView(docLayer._cellViewCursors, docLayer._onUpdateCellViewCursor, docLayer);
+ docLayer.eachView(docLayer._graphicViewMarkers, docLayer._onUpdateGraphicViewSelection, docLayer);
docLayer._clearSelections();
docLayer._updateOnChangePart();
docLayer._pruneTiles();
diff --git a/loleaflet/src/layer/tile/TileLayer.js b/loleaflet/src/layer/tile/TileLayer.js
index e9594ae..bcb2efe 100644
--- a/loleaflet/src/layer/tile/TileLayer.js
+++ b/loleaflet/src/layer/tile/TileLayer.js
@@ -1208,21 +1208,9 @@ L.TileLayer = L.GridLayer.extend({
}
},
- _updateViewCursors: function () {
- for (var key in this._viewCursors) {
- this._onUpdateViewCursor(key);
- }
- },
-
- _updateCellViewCursors: function () {
- for (var key in this._cellViewCursors) {
- this._onUpdateCellViewCursor(key);
- }
- },
-
- _updateGraphicViewSelections: function () {
- for (var key in this._graphicViewMarkers) {
- this._onUpdateGraphicViewSelection(key);
+ eachView: function (view, method, context) {
+ for (var key in view) {
+ method.call(context, key);
}
},
More information about the Libreoffice-commits
mailing list