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

Szymon KÅ‚os (via logerrit) logerrit at kemper.freedesktop.org
Wed Mar 11 14:08:25 UTC 2020


 loleaflet/css/mobilewizard.css                   |   17 +++++++++++++++++
 loleaflet/src/control/Control.JSDialogBuilder.js |   20 ++++++++++++++++----
 loleaflet/src/control/Control.MobileWizard.js    |   16 +++++++---------
 3 files changed, 40 insertions(+), 13 deletions(-)

New commits:
commit 3552ef50ce4e26af02626db62a192f66197c6801
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 15:07:43 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 11 15:07:43 2020 +0100

    jsdialog: revert previous font style listboxes
    
    Change-Id: Id2a279f81a09bc7b82293add5fb526fb4516883d

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 00864579f..e3725b15c 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1207,7 +1207,12 @@ L.Control.JSDialogBuilder = L.Control.extend({
 	},
 
 	_comboboxControl: function(parentContainer, data, builder) {
-		builder._explorableEditControl(parentContainer, data, builder);
+		if (data.id === 'applystyle' ||
+			data.id === 'fontnamecombobox' ||
+			data.id === 'fontsizecombobox')
+			builder._listboxControl(parentContainer, data, builder);
+		else
+			builder._explorableEditControl(parentContainer, data, builder);
 	},
 
 	_listboxControl: function(parentContainer, data, builder) {
commit aebc01557d260651d5ccf507a7a295dd94b059e3
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 15:03:54 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 11 15:03:54 2020 +0100

    jsdialog: better disabled button styling
    
    Change-Id: I681a1422c4b2fb63def4621d40ba7d287622a50f

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 5125e891b..732216702 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -778,6 +778,7 @@
 	}
 	#mobile-wizard button:disabled{
 		background-color: silver;
+		border-color: white;
 	}
 	#enablecontour + button {
 		float: right;
commit 12ed6dec37a3c99a2701b31f7974aad9b8b0a4d0
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 14:45:28 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 11 15:00:34 2020 +0100

    jsdialog: handle selected tab
    
    Change-Id: I80992bfe173cd48bbabf1dd1aa14fbc5701c4fa6

diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index b5b389ac9..00864579f 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -467,7 +467,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
 				var title = builder._cleanText(item.text);
 
 				var tab = L.DomUtil.create('div', 'ui-tab mobile-wizard', tabsContainer);
-				tab.id = title;
+				tab.id = data.tabs[tabIdx].name;
+				if (data.selected == data.tabs[tabIdx].id)
+					$(tab).addClass('selected');
 				tabs[tabIdx] = tab;
 
 				var label = L.DomUtil.create('span', 'ui-tab-content mobile-wizard unolabel', tab);
commit 2ca95e8538cf736fa486b3779e375971e76eb076
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 14:13:24 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 11 14:15:38 2020 +0100

    jsdialog: style disabled checkboxes
    
    Change-Id: I274f342ee8fb24ab0d0ff3d91875ca3f7332ff7d

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 09975bd72..5125e891b 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -785,4 +785,13 @@
 	}
 	div#enablecontour + p, #arrangelabel, #SetMinimalRowHeight {clear: both;}
 
+	label.disabled {
+		color: grey !important;
+	}
+
+	input[type=checkbox][disabled] {
+		background-color: grey !important;
+		border-color: grey !important;
+	}
+
 }
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index bdb47f2d2..b5b389ac9 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -593,8 +593,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		var checkbox = L.DomUtil.createWithId('input', data.id, div);
 		checkbox.type = 'checkbox';
 
-		if (data.enabled == 'false')
+		if (data.enabled == 'false') {
+			$(checkboxLabel).addClass('disabled');
 			$(checkbox).attr('disabled', 'disabled');
+		}
 
 		checkbox.addEventListener('change', function() {
 			builder.callback('checkbox', 'change', checkbox, this.checked, builder);
commit db6bb8f917ccee3b827c590e69fc4b97d0ccda3d
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 14:08:29 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 11 14:08:29 2020 +0100

    jsdialog: style disabled listboxes
    
    Change-Id: I2dbe1b63bc4266261cefb45d472aef45c3b6fd3f

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index dfae7b751..09975bd72 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -320,6 +320,10 @@
 		background-color: #fff;
 	}
 
+	.ui-header.mobile-wizard.disabled .ui-header-left * {
+		color: grey !important;
+	}
+
 	.ui-header.mobile-wizard:active, .mobile-wizard.ui-combobox-text:active, .ui-header.mobile-wizard:focus, .mobile-wizard.ui-combobox-text:focus, .ui-header.mobile-wizard:hover, .mobile-wizard.ui-combobox-text:hover {
 		background-color: #eee;
 	}
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 199c91909..bdb47f2d2 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -247,6 +247,9 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		if (data && data.id)
 			sectionTitle.id = data.id;
 
+		if (data.enabled === 'false')
+			$(sectionTitle).addClass('disabled');
+
 		var leftDiv = L.DomUtil.create('div', 'ui-header-left', sectionTitle);
 		var titleClass = '';
 		if (iconPath) {
@@ -298,7 +301,7 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		if (!data.nosubmenu)
 		{
 			$(contentDiv).hide();
-			if (builder.wizard) {
+			if (builder.wizard && data.enabled !== 'false') {
 				$(sectionTitle).click(function(event, data) {
 					builder.wizard.goLevelDown(contentDiv, data);
 					if (contentNode.onshow)
commit de4c62d26ae06c683cec9b4b992ccb66afe6add6
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 13:17:07 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 11 13:17:07 2020 +0100

    jsdialog: fix inifinite regenetate JSON loop
    
    Change-Id: I52667e115a0cf70f09f570dc6ea1ec0bcac49460

diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js
index b3b98aace..fb0f57014 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -257,7 +257,8 @@ L.Control.MobileWizard = L.Control.extend({
 	},
 
 	_goToPath: function(path) {
-		if (this._tabs && path && path.length)
+		// when dialog has tabs, tab selection triggers the callback, causes infinite regenetate loop
+		if (this._tabs && path && path.length && !this.map.dialog.hasMobilePanelOpened())
 			this._selectTab(path[0]);
 
 		for (var index in path) {
commit 3831cd719f27ac34802f7466f177c1da88241e52
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Wed Mar 11 13:01:26 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Wed Mar 11 13:02:57 2020 +0100

    jsdialog: don't forget dialog on sidebar events
    
    Change-Id: I74dc646ede106fce03c61faf953bf3c11a0744e1

diff --git a/loleaflet/src/control/Control.MobileWizard.js b/loleaflet/src/control/Control.MobileWizard.js
index c3c2991b0..b3b98aace 100644
--- a/loleaflet/src/control/Control.MobileWizard.js
+++ b/loleaflet/src/control/Control.MobileWizard.js
@@ -284,14 +284,6 @@ L.Control.MobileWizard = L.Control.extend({
 
 	_onMobileWizard: function(data) {
 		if (data) {
-
-			if (data.id && !isNaN(data.id)) {
-				// id is a number - remember window id for interaction
-				window.windowId = data.id;
-			} else {
-				window.windowId = undefined;
-			}
-
 			var isSidebar = (data.children && data.children.length >= 1 &&
 					 data.children[0].type == 'deck');
 
@@ -303,6 +295,11 @@ L.Control.MobileWizard = L.Control.extend({
 				return;
 			}
 
+			if (data.id && !isNaN(data.id) && !isSidebar) {
+				// id is a number - remember window id for interaction
+				window.windowId = data.id;
+			}
+
 			// Sometimes it happens that we get the same sidebar
 			// structure twice. This makes hard to test mobile wizard.
 			if (isSidebar && L.Browser.cypressTest) {
commit 0a06fce786ff000477d121795c70a36f78baaa22
Author:     Szymon Kłos <szymon.klos at collabora.com>
AuthorDate: Fri Mar 6 12:56:59 2020 +0100
Commit:     Szymon Kłos <szymon.klos at collabora.com>
CommitDate: Fri Mar 6 12:56:59 2020 +0100

    jsdialog: add style for disabled button
    
    Change-Id: I034470a988a79abaed8eddcb97b84a02a54dcf12

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 452e351b5..dfae7b751 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -772,6 +772,9 @@
 		border: none;
 		background-color: #ebf2fb;
 	}
+	#mobile-wizard button:disabled{
+		background-color: silver;
+	}
 	#enablecontour + button {
 		float: right;
 		margin: 24px 0px;


More information about the Libreoffice-commits mailing list