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

mert (via logerrit) logerrit at kemper.freedesktop.org
Tue Mar 31 15:52:09 UTC 2020


 loleaflet/css/mobilewizard.css                   |   13 ++++++++++
 loleaflet/src/control/Control.JSDialogBuilder.js |   29 ++++++++++++++++++++++-
 2 files changed, 41 insertions(+), 1 deletion(-)

New commits:
commit 4dad970c01ef85b4874bf753e5c6c3169fd256d8
Author:     mert <mert.tumer at collabora.com>
AuthorDate: Mon Mar 30 17:39:23 2020 +0300
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Tue Mar 31 17:51:39 2020 +0200

    mobilewizard: style clear direct formatting button
    
    Change-Id: If34aad5035270d542b49d07c3aa7fe100184ce19
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91418
    Reviewed-by: Andras Timar <andras.timar at collabora.com>
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 0110d5cef..eb1933445 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -317,6 +317,19 @@
 		background-color: #eee;
 	}
 
+	.ui-header.mobile-wizard-widebutton {
+		width: 100%;
+		height: 56px !important;
+		font-size: 11pt !important;
+		margin: 0px;
+		padding: 0px;
+		border: solid 1px #fff;
+		display: flex;
+		flex-direction: row;
+		align-items: center;
+		background-color: #fff;
+	}
+
 	.ui-content .unobutton {
 		width: 32px;
 		height: 32px;
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index a7394813f..08d5552fb 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -4,7 +4,7 @@
  * from the JSON description provided by the server.
  */
 
-/* global $ _ */
+/* global $ _ _UNO */
 
 L.Control.JSDialogBuilder = L.Control.extend({
 
@@ -71,6 +71,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		this._toolitemHandlers['.uno:FrameLineColor'] = this._colorControl;
 		this._toolitemHandlers['.uno:Color'] = this._colorControl;
 		this._toolitemHandlers['.uno:FillColor'] = this._colorControl;
+		this._toolitemHandlers['.uno:ResetAttributes'] = this._clearFormattingControl;
 
 		this._currentDepth = 0;
 	},
@@ -1389,6 +1390,32 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		return selectedColor;
 	},
 
+	_clearFormattingControl: function(parentContainer, data, builder) {
+		var iconPath = builder._createIconPath(data.command);
+		var sectionTitle = L.DomUtil.create('div', 'ui-header level-' + builder._currentDepth + ' mobile-wizard-widebutton ui-widget', parentContainer);
+		$(sectionTitle).css('justify-content', 'space-between');
+
+		if (data && data.id)
+			sectionTitle.id = data.id;
+
+		var leftDiv = L.DomUtil.create('div', 'ui-header-left', sectionTitle);
+		var titleClass = '';
+		if (iconPath) {
+			var icon = L.DomUtil.create('img', 'menu-entry-icon', leftDiv);
+			icon.src = iconPath;
+			icon.alt = '';
+			titleClass = 'menu-entry-with-icon';
+		}
+		var titleSpan = L.DomUtil.create('span', titleClass, leftDiv);
+		titleSpan.innerHTML =  builder._cleanText(_UNO(data.command));
+
+		$(sectionTitle).click(function () {
+			builder.callback('toolbutton', 'click', sectionTitle, data.command, builder);
+		});
+
+		return false;
+	},
+
 	_colorControl: function(parentContainer, data, builder) {
 		var titleOverride = builder._getTitleForControlWithId(data.id);
 		if (titleOverride)


More information about the Libreoffice-commits mailing list