summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAshod Nakashian <ashod.nakashian@collabora.co.uk>2019-02-09 20:20:03 -0500
committerJan Holesovsky <kendy@collabora.com>2019-03-14 14:37:42 +0100
commit751b8af0af38f3ab4b610b71a27b609099367e3b (patch)
treeee85811fa383732d32bea535f53e4bb1bb256083
parentAdd more source file references for breakpointing goodness (diff)
downloadonline-751b8af0af38f3ab4b610b71a27b609099367e3b.tar.gz
online-751b8af0af38f3ab4b610b71a27b609099367e3b.zip
leaflet: child windows are top-level now cp-4.0.2-1
This allows for expanding context-menus since the child submenu is no longer bound by the main context-menu, which is the parent. Change-Id: I88a24c2f16e08f98648eb01f97c0fdaff509461f Reviewed-on: https://gerrit.libreoffice.org/68251 Reviewed-by: Jan Holesovsky <kendy@collabora.com> Tested-by: Jan Holesovsky <kendy@collabora.com>
-rw-r--r--loleaflet/src/control/Control.LokDialog.js17
1 files changed, 13 insertions, 4 deletions
diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js
index cc42055604..9b5774fc63 100644
--- a/loleaflet/src/control/Control.LokDialog.js
+++ b/loleaflet/src/control/Control.LokDialog.js
@@ -625,16 +625,25 @@ L.Control.LokDialog = L.Control.extend({
},
_removeDialogChild: function(id) {
- if (typeof id === 'number')
- id = this._toStrId(id);
- $('#' + id + '-floating').remove();
+ $('#' + this._toStrId(id) + '-floating').remove();
},
_createDialogChild: function(childId, parentId, top, left) {
var strId = this._toStrId(parentId);
- var dialogContainer = L.DomUtil.get(strId);
+ var dialogContainer = L.DomUtil.get(strId).parentNode;
var floatingCanvas = L.DomUtil.create('canvas', 'lokdialogchild-canvas', dialogContainer);
$(floatingCanvas).hide(); // Hide to avoid flickering while we set the dimensions.
+
+ // Since child windows are now top-level, their 'top' offset
+ // needs adjusting. If we are in a dialog, our top is from the
+ // dialog body, not the title bar, which is a separate div.
+ // This doesn't apply for context menus, which don't have titles.
+ var dialogTitle = $('.lokdialog_notitle');
+ if (dialogTitle != null && dialogTitle.length == 0) {
+ var dialogTitleBar = $('.ui-dialog-titlebar');
+ top += dialogTitleBar.height() * L.getDpiScaleFactor();
+ }
+
floatingCanvas.id = strId + '-floating';
L.DomUtil.setStyle(floatingCanvas, 'position', 'absolute');
L.DomUtil.setStyle(floatingCanvas, 'left', left + 'px'); // yes, it's necessary to append 'px'