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@gmail.com> Tested-by: Pedro Pinto da Silva <pedro.silva@collabora.com> Reviewed-by: Pedro Pinto da Silva <pedro.silva@collabora.com>
This commit is contained in:
parent
15c2235d16
commit
8f05c15656
2 changed files with 24 additions and 10 deletions
|
@ -540,8 +540,11 @@ input.spinfield:disabled ~ .spinfieldcontrols * {
|
||||||
background-color: #f9f9f9;
|
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;
|
background-color: #f9f9f9 !important;
|
||||||
|
filter: none;
|
||||||
|
font-size: 100%;
|
||||||
|
font-weight: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*insert table special layout*/
|
/*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 {
|
div#mobile-wizard-content .spinfieldcontainer:active .spinfieldimage, div#mobile-wizard-content .spinfieldcontainer:focus .spinfieldimage, div#mobile-wizard-content .spinfieldcontainer:hover .spinfieldimage {
|
||||||
opacity: 1 !important;
|
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{
|
#buttonbefore, #buttonafter, #buttonoptimal, #buttonparallel, #buttonnone, #buttonthrough, #bottom, #top, #standard, #Bold, #Italic, #Underline, #Strikeout{
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -1044,8 +1044,10 @@ L.Control.JSDialogBuilder = L.Control.extend({
|
||||||
if (data.max != undefined)
|
if (data.max != undefined)
|
||||||
$(spinfield).attr('max', data.max);
|
$(spinfield).attr('max', data.max);
|
||||||
|
|
||||||
if (data.enabled == 'false')
|
if (data.enabled == 'false') {
|
||||||
$(spinfield).attr('disabled', 'disabled');
|
$(spinfield).attr('disabled', 'disabled');
|
||||||
|
$(image).addClass('disabled');
|
||||||
|
}
|
||||||
|
|
||||||
if (data.readOnly === true)
|
if (data.readOnly === true)
|
||||||
$(spinfield).attr('readOnly', 'true');
|
$(spinfield).attr('readOnly', 'true');
|
||||||
|
@ -1081,17 +1083,23 @@ L.Control.JSDialogBuilder = L.Control.extend({
|
||||||
});
|
});
|
||||||
|
|
||||||
plus.addEventListener('click', function() {
|
plus.addEventListener('click', function() {
|
||||||
if (customCallback)
|
var attrdisabled = $(spinfield).attr('disabled');
|
||||||
customCallback('spinfield', 'plus', div, this.value, builder);
|
if (attrdisabled !== 'disabled') {
|
||||||
else
|
if (customCallback)
|
||||||
builder.callback('spinfield', 'plus', div, this.value, builder);
|
customCallback('spinfield', 'plus', div, this.value, builder);
|
||||||
|
else
|
||||||
|
builder.callback('spinfield', 'plus', div, this.value, builder);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
minus.addEventListener('click', function() {
|
minus.addEventListener('click', function() {
|
||||||
if (customCallback)
|
var attrdisabled = $(spinfield).attr('disabled');
|
||||||
customCallback('spinfield', 'minus', div, this.value, builder);
|
if (attrdisabled !== 'disabled') {
|
||||||
else
|
if (customCallback)
|
||||||
builder.callback('spinfield', 'minus', div, this.value, builder);
|
customCallback('spinfield', 'minus', div, this.value, builder);
|
||||||
|
else
|
||||||
|
builder.callback('spinfield', 'minus', div, this.value, builder);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
if (data.hidden)
|
if (data.hidden)
|
||||||
|
|
Loading…
Reference in a new issue