[Libreoffice-commits] online.git: loleaflet/src
Henry Castro (via logerrit)
logerrit at kemper.freedesktop.org
Sat Nov 16 18:29:34 UTC 2019
loleaflet/src/control/Control.PartsPreview.js | 1 -
loleaflet/src/layer/tile/ImpressTileLayer.js | 10 +++++-----
2 files changed, 5 insertions(+), 6 deletions(-)
New commits:
commit 0d734b2aaeae6cb6154b3cdbd3d2093ad9ef3a8f
Author: Henry Castro <hcastro at collabora.com>
AuthorDate: Sat Nov 16 13:49:58 2019 -0400
Commit: Henry Castro <hcastro at collabora.com>
CommitDate: Sat Nov 16 19:29:15 2019 +0100
loleaflet: avoid using $.data jquery function
I am personally not agree to use "jquery" functions in src/* source
code, but there are some "jquery" library components (i.e.
"mCustomScrollbar") that it is dependent it, however let's minimize the
use of "jquery" functions.
Change-Id: Ic64c12d966a6215acfa900cdc05e5ddb84026f79
Reviewed-on: https://gerrit.libreoffice.org/82996
Reviewed-by: Henry Castro <hcastro at collabora.com>
Tested-by: Henry Castro <hcastro at collabora.com>
diff --git a/loleaflet/src/control/Control.PartsPreview.js b/loleaflet/src/control/Control.PartsPreview.js
index 9a52aeb10..ddc9c6041 100644
--- a/loleaflet/src/control/Control.PartsPreview.js
+++ b/loleaflet/src/control/Control.PartsPreview.js
@@ -58,7 +58,6 @@ L.Control.PartsPreview = L.Control.extend({
}
}
});
- $(this._partsPreviewCont).data('preview', this);
},
_updateDisabled: function (e) {
diff --git a/loleaflet/src/layer/tile/ImpressTileLayer.js b/loleaflet/src/layer/tile/ImpressTileLayer.js
index d35df5aaa..632dc51ce 100644
--- a/loleaflet/src/layer/tile/ImpressTileLayer.js
+++ b/loleaflet/src/layer/tile/ImpressTileLayer.js
@@ -10,6 +10,7 @@ L.ImpressTileLayer = L.TileLayer.extend({
initialize: function (url, options) {
L.TileLayer.prototype.initialize.call(this, url, options);
+ this._preview = L.control.partsPreview();
if (window.mode.isMobile()) {
this._addButton = L.control.mobileSlide();
@@ -37,7 +38,7 @@ L.ImpressTileLayer = L.TileLayer.extend({
},
beforeAdd: function (map) {
- map.addControl(L.control.partsPreview());
+ map.addControl(this._preview);
map.on('zoomend', this._onAnnotationZoom, this);
map.on('updateparts', this.onUpdateParts, this);
map.on('updatepermission', this.onUpdatePermission, this);
@@ -425,18 +426,17 @@ L.ImpressTileLayer = L.TileLayer.extend({
onOrientationChange: function () {
var container = L.DomUtil.get('presentation-controls-wrapper');
var preview = L.DomUtil.get('slide-sorter');
- var control = $(preview).data('preview');
- if (!container || !preview || !control) {
+ if (!container || !preview) {
return;
}
if (L.DomUtil.isPortrait() && $(preview).data('mCS').opt.axis !== 'x') {
$(preview).mCustomScrollbar('destroy');
- control.createScrollbar('x');
+ this._preview.createScrollbar('x');
} else if (L.DomUtil.isLandscape() && $(preview).data('mCS').opt.axis !== 'y') {
$(preview).mCustomScrollbar('destroy');
- control.createScrollbar('y');
+ this._preview.createScrollbar('y');
}
},
More information about the Libreoffice-commits
mailing list