[Libreoffice-commits] online.git: 2 commits - loleaflet/src

Szymon Kłos (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 1 08:44:03 UTC 2019


 loleaflet/src/control/Control.Menubar.js |    5 +++--
 loleaflet/src/control/Control.Toolbar.js |   31 +++++++++++++++++++------------
 2 files changed, 22 insertions(+), 14 deletions(-)

New commits:
commit 8c15584b4aff126bcde01733f469ac42cf0ce3e8
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Jul 25 13:52:50 2019 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Oct 1 10:43:48 2019 +0200

    Don't show join notification for only user
    
    Change-Id: Ibc3998cb9b760a4050ddecff602b494bf515cdf8
    Reviewed-on: https://gerrit.libreoffice.org/79938
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.Toolbar.js b/loleaflet/src/control/Control.Toolbar.js
index 207702ba5..f840eabe1 100644
--- a/loleaflet/src/control/Control.Toolbar.js
+++ b/loleaflet/src/control/Control.Toolbar.js
@@ -2245,19 +2245,27 @@ function escapeHtml(input) {
 }
 
 function onAddView(e) {
+	var userlistItem = w2ui['actionbar'].get('userlist');
 	var username = escapeHtml(e.username);
-	$('#tb_actionbar_item_userlist')
-		.w2overlay({
-			class: 'loleaflet-font',
-			html: userJoinedPopupMessage.replace('%user', username),
-			style: 'padding: 5px'
-		});
-	clearTimeout(userPopupTimeout);
-	userPopupTimeout = setTimeout(function() {
-		$('#tb_actionbar_item_userlist').w2overlay('');
+	var showPopup = false;
+
+	if (userlistItem !== null)
+		showPopup = $(userlistItem.html).find('#userlist_table tbody tr').length > 0;
+
+	if (showPopup) {
+		$('#tb_actionbar_item_userlist')
+			.w2overlay({
+				class: 'loleaflet-font',
+				html: userJoinedPopupMessage.replace('%user', username),
+				style: 'padding: 5px'
+			});
 		clearTimeout(userPopupTimeout);
-		userPopupTimeout = null;
-	}, 3000);
+		userPopupTimeout = setTimeout(function() {
+			$('#tb_actionbar_item_userlist').w2overlay('');
+			clearTimeout(userPopupTimeout);
+			userPopupTimeout = null;
+		}, 3000);
+	}
 
 	var color = L.LOUtil.rgbToHex(map.getViewColor(e.viewId));
 	if (e.viewId === map._docLayer._viewId) {
@@ -2270,7 +2278,6 @@ function onAddView(e) {
 		username += ' (' +  _('Readonly') + ')';
 	}
 
-	var userlistItem = w2ui['actionbar'].get('userlist');
 	if (userlistItem !== null) {
 		var newhtml = $(userlistItem.html).find('#userlist_table tbody').append(getUserItem(e.viewId, username, e.extraInfo, color)).parent().parent()[0].outerHTML;
 		userlistItem.html = newhtml;
commit 8ddb191d5d778962575702ff326b543f187c4ca1
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Jul 24 13:37:22 2019 +0200
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Oct 1 10:43:44 2019 +0200

    Fix language selection in menubar
    
    Change-Id: I990105361decf47f0794853a5588e9f3f66e9e6e
    Reviewed-on: https://gerrit.libreoffice.org/79937
    Reviewed-by: Szymon Kłos <szymon.klos at collabora.com>
    Tested-by: Szymon Kłos <szymon.klos at collabora.com>

diff --git a/loleaflet/src/control/Control.Menubar.js b/loleaflet/src/control/Control.Menubar.js
index 84808c65e..fc0f44f1d 100644
--- a/loleaflet/src/control/Control.Menubar.js
+++ b/loleaflet/src/control/Control.Menubar.js
@@ -680,7 +680,7 @@ L.Control.Menubar = L.Control.extend({
 			var constChecked = 'lo-menu-item-checked';
 			if (self._map._permission === 'edit') {
 				if (type === 'unocommand') { // enable all depending on stored commandStates
-					var data, lang;
+					var data, lang, languageAndCode;
 					var constUno = 'uno';
 					var constState = 'stateChangeHandler';
 					var constLanguage = '.uno:LanguageStatus';
@@ -699,7 +699,8 @@ L.Control.Menubar = L.Control.extend({
 					}
 					if (unoCommand.startsWith(constLanguage)) {
 						unoCommand = constLanguage;
-						lang = self._map[constState].getItemValue(unoCommand);
+						languageAndCode = self._map[constState].getItemValue(unoCommand);
+						lang = languageAndCode.split(';')[0];
 						data = decodeURIComponent($(aItem).data(constUno));
 						if (data.indexOf(lang) !== -1) {
 							$(aItem).addClass(constChecked);


More information about the Libreoffice-commits mailing list