[Libreoffice-commits] online.git: loleaflet/src
Tamás Zolnai (via logerrit)
logerrit at kemper.freedesktop.org
Mon May 18 10:42:11 UTC 2020
loleaflet/src/layer/FormFieldButtonLayer.js | 13 +++++++++++++
1 file changed, 13 insertions(+)
New commits:
commit 13f1f0182edd159034489caed910b5e1608d07f3
Author: Tamás Zolnai <tamas.zolnai at collabora.com>
AuthorDate: Mon May 18 11:27:54 2020 +0200
Commit: Tamás Zolnai <tamas.zolnai at collabora.com>
CommitDate: Mon May 18 12:41:48 2020 +0200
MSForms: rerender form field button on zoom.
Hide the button on zoom start and display it again with
the new size on zoom end.
Change-Id: If507009923e85225c8594252bd76033c8b84783b
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/94407
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
Reviewed-by: Tamás Zolnai <tamas.zolnai at collabora.com>
diff --git a/loleaflet/src/layer/FormFieldButtonLayer.js b/loleaflet/src/layer/FormFieldButtonLayer.js
index fcd826c28..a8c268872 100644
--- a/loleaflet/src/layer/FormFieldButtonLayer.js
+++ b/loleaflet/src/layer/FormFieldButtonLayer.js
@@ -41,6 +41,9 @@ L.FormFieldButton = L.Layer.extend({
// Build list of items opened by clicking on the drop down button
this._buildDropDownList(framePos, frameWidth, frameHeight);
+
+ map.on('zoomstart', this._onZoomStart, this);
+ map.on('zoomend', this._onZoomEnd, this);
},
_calculateButtonArea: function(map) {
@@ -161,6 +164,16 @@ L.FormFieldButton = L.Layer.extend({
this.map._socket.sendMessage(message);
},
+ _onZoomStart: function() {
+ $('.drop-down-field-list').hide();
+ this._clearButton();
+ },
+
+ _onZoomEnd: function() {
+ // rebuild button on zoom
+ this.onAdd(this.map);
+ },
+
_clearButton: function() {
this.getPane('formfieldPane').innerHTML = '';
}
More information about the Libreoffice-commits
mailing list