[Libreoffice-commits] online.git: cypress_test/integration_tests loleaflet/css loleaflet/src

Henry Castro (via logerrit) logerrit at kemper.freedesktop.org
Mon Feb 17 14:58:29 UTC 2020


 cypress_test/integration_tests/common/helper.js  |    4 ++--
 loleaflet/css/toolbar.css                        |    1 +
 loleaflet/src/control/Control.ContextMenu.js     |    2 +-
 loleaflet/src/control/Control.JSDialogBuilder.js |    7 +++++++
 4 files changed, 11 insertions(+), 3 deletions(-)

New commits:
commit cefcfcfe19f278f75540c5ae74927c8d0e311964
Author:     Henry Castro <hcastro at collabora.com>
AuthorDate: Wed Feb 12 11:51:02 2020 -0400
Commit:     Henry Castro <hcastro at collabora.com>
CommitDate: Mon Feb 17 15:58:11 2020 +0100

    loleaflet: mobile: use hyperlink tag for context menus
    
    Change-Id: Iac83687794c90ff3439e7a5c833d24007ec52ec3
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/88545
    Tested-by: Henry Castro <hcastro at collabora.com>
    Reviewed-by: Henry Castro <hcastro at collabora.com>

diff --git a/cypress_test/integration_tests/common/helper.js b/cypress_test/integration_tests/common/helper.js
index 8a8afeb84..8560880eb 100644
--- a/cypress_test/integration_tests/common/helper.js
+++ b/cypress_test/integration_tests/common/helper.js
@@ -91,7 +91,7 @@ function copyTextToClipboard() {
 		});
 
 	// Execute copy
-	cy.get('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon .context-menu-link', {timeout : 10000})
+	cy.get('.ui-header.level-0.mobile-wizard.ui-widget .context-menu-link .menu-entry-with-icon', {timeout : 10000})
 		.contains('Copy')
 		.click();
 
@@ -126,7 +126,7 @@ function copyTableToClipboard() {
 		});
 
 	// Execute copy
-	cy.get('.ui-header.level-0.mobile-wizard.ui-widget .menu-entry-with-icon .context-menu-link')
+	cy.get('.ui-header.level-0.mobile-wizard.ui-widget .context-menu-link .menu-entry-with-icon')
 		.contains('Copy')
 		.click();
 
diff --git a/loleaflet/css/toolbar.css b/loleaflet/css/toolbar.css
index 65921b617..408023067 100644
--- a/loleaflet/css/toolbar.css
+++ b/loleaflet/css/toolbar.css
@@ -823,6 +823,7 @@ tr.useritem > td > img {
 .context-menu-link {
 		text-decoration: none;
 		color: black;
+		width: 100%;
 }
 .menu-entry-icon {
 	width: 32px;
diff --git a/loleaflet/src/control/Control.ContextMenu.js b/loleaflet/src/control/Control.ContextMenu.js
index 9bc7a23c2..b5db30d02 100644
--- a/loleaflet/src/control/Control.ContextMenu.js
+++ b/loleaflet/src/control/Control.ContextMenu.js
@@ -234,7 +234,7 @@ L.Control.ContextMenu = L.Control.extend({
 
 				contextMenu[item.command] = {
 					// Using 'click' and <a href='#' is vital for copy/paste security context.
-					name: '<a href="#" class="context-menu-link">' +  _(itemName) + '</a',
+					name: (window.mode.isMobile() ? _(itemName) : '<a href="#" class="context-menu-link">' +  _(itemName) + '</a'),
 					isHtmlName: true,
 				};
 
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 04a1abb0d..2f2e6a9dc 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1456,6 +1456,11 @@ L.Control.JSDialogBuilder = L.Control.extend({
 
 		var menuEntry = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer);
 
+		if (data.hyperlink) {
+			menuEntry = L.DomUtil.create('a', 'context-menu-link', menuEntry);
+			menuEntry.href = '#';
+		}
+
 		var icon = null;
 		var commandName = data.command && data.command.substring(0, '.uno:'.length) === '.uno:' ? data.command.substring('.uno:'.length) : data.id;
 		if (commandName && commandName.length && L.LOUtil.existsIconForCommand(commandName)) {
@@ -1634,6 +1639,8 @@ L.Control.JSDialogBuilder.getMenuStructureForMobileWizard = function(menu, mainM
 		menuStructure['checked'] = true;
 	if (menu.callback)
 		menuStructure['callback'] = menu.callback;
+	if (menu.isHtmlName)
+		menuStructure['hyperlink'] = true;
 
 	if (mainMenu) {
 		for (var menuItem in menu) {


More information about the Libreoffice-commits mailing list