diff options
author | Henry Castro <hcastro@collabora.com> | 2021-12-24 15:31:23 -0400 |
---|---|---|
committer | Henry Castro <hcastro@collabora.com> | 2022-08-03 09:45:23 -0400 |
commit | 214322d3f0d6018e69b2f304e764941b0e3664f8 (patch) | |
tree | 49d7984b0f961f2c8ff4ecde4346f06779b8f95b | |
parent | android: fix closing the document on interactive dialogs (diff) | |
download | online-214322d3f0d6018e69b2f304e764941b0e3664f8.tar.gz online-214322d3f0d6018e69b2f304e764941b0e3664f8.zip |
browser: add 'dropdown' dialog type
Adjust the drop-down dialog to the #map element
to show the correct position sent by the server.
Change-Id: I74a6d7402438241aae77a18699c3297d64b34098
Signed-off-by: Henry Castro <hcastro@collabora.com>
-rw-r--r-- | browser/src/control/Control.LokDialog.js | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/browser/src/control/Control.LokDialog.js b/browser/src/control/Control.LokDialog.js index bfb90b7473..fcced8a371 100644 --- a/browser/src/control/Control.LokDialog.js +++ b/browser/src/control/Control.LokDialog.js @@ -282,7 +282,8 @@ L.Control.LokDialog = L.Control.extend({ e.winType !== 'calc-input-win' && e.winType !== 'child' && e.winType !== 'deck' && - e.winType !== 'tooltip') { + e.winType !== 'tooltip' && + e.winType !== 'dropdown') { return; } @@ -310,7 +311,7 @@ L.Control.LokDialog = L.Control.extend({ } if (e.action === 'created') { - if (e.winType === 'dialog' && !window.mode.isMobile()) { + if ((e.winType === 'dialog' || e.winType === 'dropdown') && !window.mode.isMobile()) { // When left/top are invalid, the dialog shows in the center. this._launchDialog(e.id, left, top, width, height, e.title); } else if (e.winType === 'calc-input-win') { @@ -756,7 +757,7 @@ L.Control.LokDialog = L.Control.extend({ return changed; }, - _launchDialog: function(id, leftTwips, topTwips, width, height, title) { + _launchDialog: function(id, leftTwips, topTwips, width, height, title, type) { if (window.ThisIsTheiOSApp) { if (w2ui['editbar']) w2ui['editbar'].disable('closemobile'); @@ -807,7 +808,11 @@ L.Control.LokDialog = L.Control.extend({ var top = pixels.y + panePos.y - origin.y; if (left >= 0 && top >= 0) { - $(dialogContainer).dialog('option', 'position', { my: 'left top', at: 'left+' + left + ' top+' + top, of: '#document-container' }); + $(dialogContainer).dialog('option', 'position', + { my: 'left top', + at: 'left+' + left + ' top+' + top, + of: type === 'dropdown' ? '#map' : + '#document-container' }); } } |