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

Pedro Pinto Silva (via logerrit) logerrit at kemper.freedesktop.org
Tue Jan 28 16:48:02 UTC 2020


 loleaflet/css/mobilewizard.css                   |    3 ++
 loleaflet/images/lc_inserttable_mono.svg         |    1 
 loleaflet/src/control/Control.JSDialogBuilder.js |   26 +++++++++++++++++++----
 3 files changed, 26 insertions(+), 4 deletions(-)

New commits:
commit 5b44398bccecfe1865e75c1256aad8012d275dcb
Author:     Pedro Pinto Silva <pedro.silva at collabora.com>
AuthorDate: Tue Jan 28 15:37:25 2020 +0100
Commit:     Pedro Pinto da Silva <pedro.silva at collabora.com>
CommitDate: Tue Jan 28 17:47:34 2020 +0100

    MobileWizard: Insert: Table:
    
    - Add exeption
    - Even if there is no image passed add it manually and adjust HTML sctructure so to be consistent with other menu-entry-with-icon elements
    - Add inserttable monochrome icon
    - pass optional argument data.id
    
    Change-Id: I34536272d3ef5742895c4db5a52058fe6558f837
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/87633
    Reviewed-by: Pedro Pinto da Silva <pedro.silva at collabora.com>
    Tested-by: Pedro Pinto da Silva <pedro.silva at collabora.com>

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index aaae8b01c..d5d67b8e9 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -363,6 +363,9 @@
 	.ui-header.level-1.mobile-wizard.ui-widget .ui-header-left span.menu-entry-with-icon {
 		vertical-align: middle;
 	}
+	.flex-fullwidth {
+		flex-grow: 100;
+	}
 
 	.ui-tabs.mobile-wizard {
 		text-align: center;
diff --git a/loleaflet/images/lc_inserttable_mono.svg b/loleaflet/images/lc_inserttable_mono.svg
new file mode 100644
index 000000000..13c8fca45
--- /dev/null
+++ b/loleaflet/images/lc_inserttable_mono.svg
@@ -0,0 +1 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 2H4c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zM8 20H4v-4h4v4zm0-6H4v-4h4v4zm0-6H4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4zm6 12h-4v-4h4v4zm0-6h-4v-4h4v4zm0-6h-4V4h4v4z" fill="#555555"/></svg>
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index a3dcdb844..027934cb5 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -343,12 +343,30 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		}
 	},
 
-	_explorableMenu: function(parentContainer, title, children, builder, customContent) {
+	_explorableMenu: function(parentContainer, title, children, builder, customContent, dataid) {
+		dataid = dataid || 0;
+		var icon = null;
 		var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard ui-widget', parentContainer);
 		$(sectionTitle).css('justify-content', 'space-between');
 
-		var titleSpan = L.DomUtil.create('span', 'sub-menu-title', sectionTitle);
-		titleSpan.innerHTML = title;
+
+		if (dataid === 'inserttable') {
+			var iconSpan = L.DomUtil.create('span', 'menu-entry-icon inserttable', sectionTitle);
+			var iconPath = 'images/lc_inserttable_mono.svg';
+			icon = L.DomUtil.create('img', '', iconSpan);
+			icon.src = iconPath;
+			icon.alt = '';
+			icon.addEventListener('error', function() {
+				icon.style.display = 'none';
+			});
+
+			var titleSpan2 = L.DomUtil.create('span', 'menu-entry-with-icon flex-fullwidth', sectionTitle);
+			titleSpan2.innerHTML = title;
+		}
+		else {
+			var titleSpan = L.DomUtil.create('span', 'sub-menu-title', sectionTitle);
+			titleSpan.innerHTML = title;
+		}
 		var arrowSpan = L.DomUtil.create('span', 'sub-menu-arrow', sectionTitle);
 		arrowSpan.innerHTML = '>';
 
@@ -1509,7 +1527,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 			builder.map.fire('closemobilewizard');
 		});
 
-		builder._explorableMenu(parentContainer, title, data.children, builder, content);
+		builder._explorableMenu(parentContainer, title, data.children, builder, content, data.id);
 	},
 
 	build: function(parent, data) {


More information about the Libreoffice-commits mailing list