[Libreoffice-commits] online.git: Branch 'distro/collabora/co-4-2' - loleaflet/css loleaflet/src

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Tue Aug 11 11:47:29 UTC 2020


 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 <szymon.klos at collabora.com>
AuthorDate: Tue Aug 11 07:56:26 2020 +0200
Commit:     Jan Holesovsky <kendy at collabora.com>
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 <jenkinscollaboraoffice at gmail.com>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

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;
+}
+
+ at 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) : ''));
 		}
 	},


More information about the Libreoffice-commits mailing list