User tests: Successful: Unsuccessful:
Edit administrator/components/com_config/model/form/application.xml
and replace lines 255-265 with:
<field
name="debug"
type="radio"
disabled="true"
class="btn-group btn-group-yesno"
default="0"
label="COM_CONFIG_FIELD_DEBUG_SYSTEM_LABEL"
description="COM_CONFIG_FIELD_DEBUG_SYSTEM_DESC"
filter="integer">
<option value="1">JYES</option>
<option value="0">JNO</option>
</field>
Although the input SHOULD be disabled, user can change it
Apply the patch and repeat the above steps that reveal the problem
Status | New | ⇒ | Pending |
Labels |
Added:
?
|
I have tested this item
I guess this only works if we have the btn-group-yesno class but this is no requirement or I reading it wrong?
Category | ⇒ | Fields JavaScript |
Why would you ever want to disable them?
sometimes you would want to let the field show
to let the user see it but don't allow user to use it
also at a later time someone can re-enable it programmatically with something like:
// enable clicks on fieldset
fieldSet.removeAttr('disabled').removeClass('disabled').css('pointer-events', 'auto').on('click');
// find inner disabled inputs and enabled them
fieldSet.find('input').removeAttr('disabled');
@brianteeman according to standards a radio input CAN be disabled: http://www.w3.org/TR/html-markup/input.radio.html
yes we want to fix the bootstrap issue of allowing clicks, in case of not using bootstrap then all browser should handle disabled "input" correctly
just you should use:
btn-group
and not limit it to
btn-group-yesno
some radio-set only use: btn-group
instead of: btn-group btn-group-yesno
thus if use: btn-group
it does not work
This PR has received new commits.
CC: @wojsmol
Yes, now works
what about making the code similar to the other selectors:
so maybe code should be:
$('.btn-group').each(function() {
// Handle disabled property
if ($(this).prop('disabled')) {
$(this).addClass('disabled').css('pointer-events', 'none').off('click');
}
});
This PR has received new commits.
CC: @wojsmol
I have tested this item
thanks for the latest change, just you forgot a space:
selector
$('fieldset .btn-group')
should be without space:
$('fieldset.btn-group')
[EDIT]
if you let the space be there, it will only work
if the fieldset.btn-group is inside an outer fieldset, which usually is true, but we should not rely on this
This PR has received new commits.
CC: @brianteeman, @wojsmol
I have tested this item
also i see your point for using
$('fieldset.btn-group')
instead of
$('.btn-group')
yes, i think it is better to do it like this, playing safer, and adding a case in future if needed
Ok 1 more test needed,
but these file should be updated too, with same code (but different PR ?), :
https://github.com/joomla/joomla-cms/blob/staging/installation/template/index.php#L93
https://github.com/joomla/joomla-cms/blob/staging/templates/beez3/javascript/template.js#L15
https://github.com/joomla/joomla-cms/blob/staging/templates/protostar/js/template.js#L15
also same JS is needed for "readonly" case, but that will also need layout updating of the form element (i think) and a new CSS class for styling ?, so it should be a different PR
Relevant issue:
#8996
I have tested this item
This PR has received new commits.
CC: @brianteeman, @ggppdk, @wojsmol
Applied patch with patch-tester and tested all 4cases and it worked, but only "isis" template has class "disabled", thus CSS lower opacity appear only for it
tested installation,
renamed 'configuration.php'
and edited file installation\model\forms\site.xml
... added 'disabled="true" to 'site_offline' parameter, (it is already type="radio" class="btn-group")
(re)tested backend "isis" template
tested by changing 'state' of 'components\com_content\models\forms\article.xml'
to ' type="radio" class="btn-group" disabled="true" '
Maybe change:
$(this).addClass('disabled').css('pointer-events', 'none').off('click');
to ?
$(this).css('pointer-events', 'none').css('opacity', '0.65').off('click');
although i understand that unline 'pointer-events', which is a matter of proper behaviour of the disabled element,
the opacity for the element, in order to look disabled, should be left to the CSS of the template ...
yes you are right that should work,
you can add the 'disabled' CSS class to the 'btn' elements instead of the FIELDSET
so it will be:
$('fieldset.btn-group').each(function() {
// Handle disabled, prevent clicks on the container, and add disabled style to each button
if ($(this).prop('disabled')) {
$(this).css('pointer-events', 'none').off('click');
$(this).find('.btn').addClass('disabled');
}
});
I have tested this item
There are 4 changes, not 1 to be tested, 4 templates were changed not 1
This PR has received new commits.
CC: @brianteeman, @ggppdk, @Ruchiranga, @wojsmol
This PR has received new commits.
CC: @brianteeman, @ggppdk, @Ruchiranga, @wojsmol
I have tested this item
Applied patch with patch-tester and tested all 4 cases and ' disabled="true" class="btn-group" ' worked as expected
Of course without disabled="true" the buttons appear and work / submit normally
1 . tested installation,
renamed 'configuration.php'
and edited file installation\model\forms\site.xml
... added 'disabled="true" to 'site_offline' parameter, (it is already type="radio" class="btn-group")
tested by changing 'state' of 'components\com_content\models\forms\article.xml'
to ' type="radio" class="btn-group" disabled="true" '
I have tested this item
Applied the patch according to testing instructions. All the cases works good!
Status | Pending | ⇒ | Ready to Commit |
RTC. Thanks
Labels |
Added:
?
|
Milestone |
Added: |
Status | Ready to Commit | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2016-07-16 08:42:04 |
Closed_By | ⇒ | roland-d |
Labels |
Removed:
?
|
Hello
i was going to suggest a fix for this, but never did
i don't remember 100%, but i had tested at the disabled field something like
something like
but your PR seems good i will test it tomorrow