[Libreoffice-commits] online.git: Branch 'feature/jsdialogs' - 6 commits - loleaflet/css loleaflet/src

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Sun Mar 22 13:26:48 UTC 2020


 loleaflet/css/mobilewizard.css                   |   10 ++++++--
 loleaflet/src/control/Control.JSDialogBuilder.js |   27 ++++++++++++++++++-----
 2 files changed, 30 insertions(+), 7 deletions(-)

New commits:
commit b040fe13b18aa49f647772aca4aacac4a3fc7a7a
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Thu Mar 19 14:02:21 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Thu Mar 19 14:02:21 2020 +0100

    jsdialog: add custom text for select range button

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 5efb372e2..fc084bdfc 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1130,9 +1130,17 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		return false;
 	},
 
+	_customPushButtonTextForId: function(buttonId) {
+		if (buttonId == 'validref')
+			return _('Select range');
+
+		return '';
+	},
+
 	_pushbuttonControl: function(parentContainer, data, builder, customCallback) {
 		var pushbutton = L.DomUtil.create('button', '', parentContainer);
-		pushbutton.innerHTML = builder._cleanText(data.text);
+		var customText = builder._customPushButtonTextForId(data.id);
+		pushbutton.innerHTML = customText !== '' ? customText : builder._cleanText(data.text);
 		pushbutton.id = data.id;
 
 		if (data.enabled == 'false')
commit 4c271743ab37a6e9c808151beb7dd93e799993cb
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 18 14:47:36 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 18 14:47:36 2020 +0100

    jsdialog: full width combobox

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index b5f147329..9bb813415 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -806,6 +806,11 @@
 		width: 100%;
 	}
 
+	.combobox {
+		width: -moz-available !important;
+		width: -webkit-fill-available !important;
+	}
+
 	.ui-edit.mobile-wizard, textarea {
 		width: -moz-available;
 		width: -webkit-fill-available;
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 6398649ad..5efb372e2 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1165,7 +1165,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		if (data && data.id)
 			sectionTitle.id = data.id;
 
-		var leftDiv = L.DomUtil.create('div', 'ui-header-left', sectionTitle);
+		var leftDiv = L.DomUtil.create('div', 'ui-header-left combobox', sectionTitle);
 
 		var editCallback = function(value) {
 			builder.callback('combobox', 'change', data, value, builder);
commit 13d87353775956464da6cb7ad9c9a58a55542c58
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 18 14:45:22 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 18 14:45:22 2020 +0100

    jsdialog: keep edit field in line with arrow

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 51b856ca7..b5f147329 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -809,7 +809,7 @@
 	.ui-edit.mobile-wizard, textarea {
 		width: -moz-available;
 		width: -webkit-fill-available;
-		margin: 0px 5% 10px 5% !important;
+		margin: 10px 5% 10px 5% !important;
 	}
 
 	#label9, #documentlabel-mobile {
commit c66053fa9d889b4c8e21f40eeaab4da86083af9f
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 18 13:01:59 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 18 13:01:59 2020 +0100

    jsdialog: fix checkbox

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 24e549444..6398649ad 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -603,7 +603,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		}
 
 		checkbox.addEventListener('change', function() {
-			builder.callback('checkbox', 'change', checkbox, this.checked, builder);
+			builder.callback('checkbox', 'change', div, this.checked, builder);
 		});
 
 		var customCommand = builder._mapWindowIdToUnoCommand(data.id);
commit 8148837e06623b5b394e175d026aa7d4a11c82ff
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Tue Mar 17 15:17:57 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Mar 17 15:29:42 2020 +0100

    jsdialog: textarea without cursor is a paragraph

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index a2a355c4f..24e549444 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1101,8 +1101,17 @@ L.Control.JSDialogBuilder = L.Control.extend({
 	},
 
 	_multiLineEditControl: function(parentContainer, data, builder, callback) {
-		var edit = L.DomUtil.create('textarea', '', parentContainer);
-		edit.value = builder._cleanText(data.text);
+		var controlType = 'textarea';
+		if (data.cursor && data.cursor === 'false')
+			controlType = 'p';
+
+		var edit = L.DomUtil.create(controlType, '', parentContainer);
+
+		if (controlType === 'textarea')
+			edit.value = builder._cleanText(data.text);
+		else
+			edit.innerHTML = builder._cleanText(data.text);
+
 		edit.id = data.id;
 
 		if (data.enabled == 'false')
commit 73ae188c3926730f98abdbb7f3aeadde592b4fed
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Mon Mar 16 19:08:38 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Tue Mar 17 15:29:35 2020 +0100

    jsdialog: edit control full width

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 0b58c0773..51b856ca7 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -807,8 +807,9 @@
 	}
 
 	.ui-edit.mobile-wizard, textarea {
-		margin-left: 5% !important;
-		margin-bottom: 10px;
+		width: -moz-available;
+		width: -webkit-fill-available;
+		margin: 0px 5% 10px 5% !important;
 	}
 
 	#label9, #documentlabel-mobile {


More information about the Libreoffice-commits mailing list