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

Pedro Pinto Silva (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 23 12:31:50 UTC 2020


 loleaflet/css/mobilewizard.css                   |    8 ++++++-
 loleaflet/src/control/Control.JSDialogBuilder.js |   26 +++++++++++++++--------
 2 files changed, 24 insertions(+), 10 deletions(-)

New commits:
commit 8f05c156563b882f3e843df54dbd46f142b804a3
Author:     Pedro Pinto Silva <pedro.silva at collabora.com>
AuthorDate: Thu Apr 23 14:11:42 2020 +0200
Commit:     Pedro Pinto da Silva <pedro.silva at collabora.com>
CommitDate: Thu Apr 23 14:31:31 2020 +0200

    Mobile: mWizard: disabled input fields: make sure both image and spinfield controls do not stay active
    
    And make sure the js listener is only added when the inputfield is enabled (fixing useless callbacks and changes on html)
    
    Change-Id: I4f4f2b4430b1c43143f95ab9d9fe075c8e1f49b8
    Reviewed-on: https://gerrit.libreoffice.org/c/online/+/92763
    Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice at gmail.com>
    Tested-by: Pedro Pinto da Silva <pedro.silva at collabora.com>
    Reviewed-by: Pedro Pinto da Silva <pedro.silva at collabora.com>

diff --git a/loleaflet/css/mobilewizard.css b/loleaflet/css/mobilewizard.css
index 1a8919e4e..d2b7d73b6 100644
--- a/loleaflet/css/mobilewizard.css
+++ b/loleaflet/css/mobilewizard.css
@@ -540,8 +540,11 @@ input.spinfield:disabled ~ .spinfieldcontrols * {
 	background-color: #f9f9f9;
 }
 
-input.spinfield:disabled ~ .spinfieldcontrols *:active {
+input.spinfield:disabled ~ .spinfieldcontrols *:active, input.spinfield:disabled ~ .spinfieldcontrols *:hover, input.spinfield:disabled ~ .spinfieldcontrols *:focus {
 	background-color: #f9f9f9 !important;
+	filter: none;
+	font-size: 100%;
+	font-weight: normal;
 }
 
 /*insert table special layout*/
@@ -701,6 +704,9 @@ div#mobile-wizard-content .spinfieldcontainer .spinfieldimage {
 div#mobile-wizard-content .spinfieldcontainer:active .spinfieldimage, div#mobile-wizard-content .spinfieldcontainer:focus .spinfieldimage, div#mobile-wizard-content .spinfieldcontainer:hover .spinfieldimage {
 	opacity: 1 !important;
 }
+div#mobile-wizard-content .spinfieldcontainer .spinfieldimage.disabled {
+	opacity: 0.5 !important;
+}
 #buttonbefore, #buttonafter, #buttonoptimal, #buttonparallel, #buttonnone, #buttonthrough, #bottom, #top, #standard, #Bold, #Italic, #Underline, #Strikeout{
 	margin: 0;
 	padding: 0;
diff --git a/loleaflet/src/control/Control.JSDialogBuilder.js b/loleaflet/src/control/Control.JSDialogBuilder.js
index 323f69bd7..c9a410feb 100644
--- a/loleaflet/src/control/Control.JSDialogBuilder.js
+++ b/loleaflet/src/control/Control.JSDialogBuilder.js
@@ -1044,8 +1044,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		if (data.max != undefined)
 			$(spinfield).attr('max', data.max);
 
-		if (data.enabled == 'false')
+		if (data.enabled == 'false') {
 			$(spinfield).attr('disabled', 'disabled');
+			$(image).addClass('disabled');
+		}
 
 		if (data.readOnly === true)
 			$(spinfield).attr('readOnly', 'true');
@@ -1081,17 +1083,23 @@ L.Control.JSDialogBuilder = L.Control.extend({
 		});
 
 		plus.addEventListener('click', function() {
-			if (customCallback)
-				customCallback('spinfield', 'plus', div, this.value, builder);
-			else
-				builder.callback('spinfield', 'plus', div, this.value, builder);
+			var attrdisabled = $(spinfield).attr('disabled');
+			if (attrdisabled !== 'disabled') {
+				if (customCallback)
+					customCallback('spinfield', 'plus', div, this.value, builder);
+				else
+					builder.callback('spinfield', 'plus', div, this.value, builder);
+			}
 		});
 
 		minus.addEventListener('click', function() {
-			if (customCallback)
-				customCallback('spinfield', 'minus', div, this.value, builder);
-			else
-				builder.callback('spinfield', 'minus', div, this.value, builder);
+			var attrdisabled = $(spinfield).attr('disabled');
+			if (attrdisabled !== 'disabled') {
+				if (customCallback)
+					customCallback('spinfield', 'minus', div, this.value, builder);
+				else
+					builder.callback('spinfield', 'minus', div, this.value, builder);
+			}
 		});
 
 		if (data.hidden)


More information about the Libreoffice-commits mailing list