Browse Source

#2434 - Label no longer shows hand cursor unless initialized with JS, fixed destroy to return input z-index

pull/2477/head
jlukic 9 years ago
parent
commit
b42bcbde1d
2 changed files with 18 additions and 8 deletions
  1. 14
      src/definitions/modules/checkbox.js
  2. 12
      src/definitions/modules/checkbox.less

14
src/definitions/modules/checkbox.js

@ -78,13 +78,11 @@ $.fn.checkbox = function(parameters) {
destroy: function() { destroy: function() {
module.verbose('Destroying module'); module.verbose('Destroying module');
module.unbind.events(); module.unbind.events();
$module
.removeData(moduleNamespace)
;
module.show.input();
$module.removeData(moduleNamespace);
}, },
fix: { fix: {
reference: function() { reference: function() {
if( $module.is(selector.input) ) { if( $module.is(selector.input) ) {
module.debug('Behavior called on <input> adjusting invoked element'); module.debug('Behavior called on <input> adjusting invoked element');
@ -128,10 +126,16 @@ $.fn.checkbox = function(parameters) {
hide: { hide: {
input: function() { input: function() {
module.verbose('Modfying <input> z-index');
module.verbose('Modfying <input> z-index to be unselectable');
$input.addClass(className.hidden); $input.addClass(className.hidden);
} }
}, },
show: {
input: function() {
module.verbose('Modfying <input> z-index to be selectable');
$input.removeClass(className.hidden);
}
},
observeChanges: function() { observeChanges: function() {
if('MutationObserver' in window) { if('MutationObserver' in window) {

12
src/definitions/modules/checkbox.less

@ -60,9 +60,9 @@
.ui.checkbox .box, .ui.checkbox .box,
.ui.checkbox label { .ui.checkbox label {
cursor: auto;
position: relative; position: relative;
display: block; display: block;
cursor: pointer;
padding-left: @labelDistance; padding-left: @labelDistance;
outline: none; outline: none;
} }
@ -115,10 +115,8 @@
/* Inside */ /* Inside */
.ui.checkbox label, .ui.checkbox label,
.ui.checkbox + label { .ui.checkbox + label {
cursor: pointer;
color: @labelColor; color: @labelColor;
transition: @labelTransition; transition: @labelTransition;
user-select: none;
} }
/* Outside */ /* Outside */
@ -263,6 +261,14 @@
z-index: -1; z-index: -1;
} }
/* Selectable Label */
.ui.checkbox input[type="checkbox"].hidden + label,
.ui.checkbox input[type="radio"].hidden + label {
cursor: pointer;
user-select: none;
}
/******************************* /*******************************

Loading…
Cancel
Save