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 <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Jan Holesovsky <kendy@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/101820
Tested-by: Jenkins
Reviewed-by: Szymon Kłos <szymon.klos@collabora.com>
This commit is contained in:
Szymon Kłos 2020-08-11 07:56:26 +02:00
parent 433b108c50
commit bb015fe41e
3 changed files with 26 additions and 1 deletions

View file

@ -577,6 +577,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;

View file

@ -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();

View file

@ -178,7 +178,13 @@ L.Map.include({
}
}
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) {
if (!this.messageNeedsToBeRedirected(command))
this._socket.sendMessage('uno ' + command + (json ? ' ' + JSON.stringify(json) : ''));
}