loleaflet/css/loleaflet.css | 9 +++++++++ loleaflet/src/control/Control.LokDialog.js | 10 ++++++++++ loleaflet/src/control/Toolbar.js | 8 +++++++- 3 files changed, 26 insertions(+), 1 deletion(-)
New commits: commit e51ca347694dbb15edb1806c1b2a2290238948d2 Author: Szymon Kłos <[email protected]> AuthorDate: Tue Aug 11 07:56:26 2020 +0200 Commit: Jan Holesovsky <[email protected]> CommitDate: Tue Aug 11 13:47:09 2020 +0200 Don't allow to open multiple dialogs and blink active dialog to inform user that he needs to close dialog first... Change-Id: I6c9ee662ae2ab935f03ee8fdd0cf7327703e2170 Reviewed-on: https://gerrit.libreoffice.org/c/online/+/100457 Tested-by: Jenkins CollaboraOffice <[email protected]> Reviewed-by: Jan Holesovsky <[email protected]> diff --git a/loleaflet/css/loleaflet.css b/loleaflet/css/loleaflet.css index 0d7d7e05a..8fe837734 100644 --- a/loleaflet/css/loleaflet.css +++ b/loleaflet/css/loleaflet.css @@ -544,6 +544,15 @@ body { -o-user-select: none; } +.lokblink { + animation: blink 150ms infinite alternate; +} + +@keyframes blink { + from { opacity:1; } + to { opacity:0; } +} + .form-field-frame { border: 1px solid; position: absolute; diff --git a/loleaflet/src/control/Control.LokDialog.js b/loleaflet/src/control/Control.LokDialog.js index 7fec217d4..b69c0e446 100644 --- a/loleaflet/src/control/Control.LokDialog.js +++ b/loleaflet/src/control/Control.LokDialog.js @@ -134,6 +134,16 @@ L.Control.LokDialog = L.Control.extend({ _currentDeck: null, // The sidebar. _calcInputBar: null, // The Formula-Bar. + hasOpenedDialog: function() { + var nonDialogEntries = 0; + for (var index in this._dialogs) { + if (this._dialogs[index].isSidebar || this._dialogs[index].isCalcInputBar) + nonDialogEntries++; + } + + return Object.keys(this._dialogs).length > nonDialogEntries; + }, + _docLoaded: function(e) { if (!e.status) { $('.lokdialog_container').remove(); diff --git a/loleaflet/src/control/Toolbar.js b/loleaflet/src/control/Toolbar.js index 1b55c34b8..19b899d75 100644 --- a/loleaflet/src/control/Toolbar.js +++ b/loleaflet/src/control/Toolbar.js @@ -158,7 +158,13 @@ L.Map.include({ sendUnoCommand: function (command, json) { var isAllowedInReadOnly = command == '.uno:WordCountDialog'; - if (this.isPermissionEdit() || isAllowedInReadOnly) { + var hasOpenedDialog = this.dialog.hasOpenedDialog(); + if (hasOpenedDialog) { + $('.lokdialog_container').addClass('lokblink'); + setTimeout(function () { + $('.lokdialog_container').removeClass('lokblink'); + }, 600); + } else if (this.isPermissionEdit() || isAllowedInReadOnly) { this._socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : '')); } }, _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
