mirror of
https://github.com/mdbootstrap/mdb-ui-kit.git
synced 2024-11-13 13:17:03 +03:00
Merge pull request #1010 from tilwinjoy/disabled-cursor-fix
Disabled cursor fix for checkbox and radio
This commit is contained in:
commit
cd0ee750b6
|
@ -37,15 +37,34 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function _toggleDisabledState($element, state) {
|
||||||
|
var $target;
|
||||||
|
if ($element.hasClass('checkbox-inline') || $element.hasClass('radio-inline')) {
|
||||||
|
$target = $element;
|
||||||
|
} else {
|
||||||
|
$target = $element.closest('.checkbox').length ? $element.closest('.checkbox') : $element.closest('.radio');
|
||||||
|
}
|
||||||
|
return $target.toggleClass('disabled', state);
|
||||||
|
}
|
||||||
|
|
||||||
function _toggleTypeFocus($input) {
|
function _toggleTypeFocus($input) {
|
||||||
|
var disabledToggleType = false;
|
||||||
|
if ($input.is($.material.options.checkboxElements) || $input.is($.material.options.radioElements)) {
|
||||||
|
disabledToggleType = true;
|
||||||
|
}
|
||||||
$input.closest('label').hover(function () {
|
$input.closest('label').hover(function () {
|
||||||
var $i = $(this).find('input');
|
var $i = $(this).find('input');
|
||||||
if (!$i.prop('disabled')) { // hack because the _addFormGroupFocus() wasn't identifying the property on chrome
|
var isDisabled = $i.prop('disabled'); // hack because the _addFormGroupFocus() wasn't identifying the property on chrome
|
||||||
_addFormGroupFocus($i); // need to find the input so we can check disablement
|
if (disabledToggleType) {
|
||||||
}
|
_toggleDisabledState($(this), isDisabled);
|
||||||
}, function () {
|
}
|
||||||
_removeFormGroupFocus($(this).find('input'));
|
if (!isDisabled) {
|
||||||
});
|
_addFormGroupFocus($i); // need to find the input so we can check disablement
|
||||||
|
}
|
||||||
|
},
|
||||||
|
function () {
|
||||||
|
_removeFormGroupFocus($(this).find('input'));
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function _removeFormGroupFocus(element) {
|
function _removeFormGroupFocus(element) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user