Added disabled status to switches

Former-commit-id: 7fee49f58e4be84bfb8bad08303b203d71dafe16
This commit is contained in:
fermin831 2019-02-06 18:18:48 +01:00
parent 6ddcfcbb19
commit 37d02ddf59
2 changed files with 6 additions and 1 deletions

View File

@ -2593,9 +2593,10 @@ function html_print_switch ($attributes = array()) {
$name_html = isset($attributes['name']) ? "name = {$attributes['name']}" : '';
$checked_html = (bool)$attributes['value'] ? 'checked' : '';
$disabled_html = (bool)$attributes['disabled'] ? 'disabled' : '';
return
"<label class='p-switch'>
<input type='checkbox' $name_html $checked_html>
<input type='checkbox' $name_html $checked_html $disabled_html>
<span class='p-slider'></span>
</label>";
}

View File

@ -5290,4 +5290,8 @@ input:checked + .p-slider:before {
transform: translateX(13px);
}
input:disabled + .p-slider {
opacity: 0.4;
}
/* --- END SWITCH --- */