From b42bcbde1dbd20623cc52c3977b2656f6861f659 Mon Sep 17 00:00:00 2001 From: jlukic Date: Mon, 29 Jun 2015 15:01:15 -0400 Subject: [PATCH] #2434 - Label no longer shows hand cursor unless initialized with JS, fixed destroy to return input z-index --- src/definitions/modules/checkbox.js | 14 +++++++++----- src/definitions/modules/checkbox.less | 12 +++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/definitions/modules/checkbox.js b/src/definitions/modules/checkbox.js index 738bf9427..49e1786b7 100644 --- a/src/definitions/modules/checkbox.js +++ b/src/definitions/modules/checkbox.js @@ -78,13 +78,11 @@ $.fn.checkbox = function(parameters) { destroy: function() { module.verbose('Destroying module'); module.unbind.events(); - $module - .removeData(moduleNamespace) - ; + module.show.input(); + $module.removeData(moduleNamespace); }, fix: { - reference: function() { if( $module.is(selector.input) ) { module.debug('Behavior called on adjusting invoked element'); @@ -128,10 +126,16 @@ $.fn.checkbox = function(parameters) { hide: { input: function() { - module.verbose('Modfying z-index'); + module.verbose('Modfying z-index to be unselectable'); $input.addClass(className.hidden); } }, + show: { + input: function() { + module.verbose('Modfying z-index to be selectable'); + $input.removeClass(className.hidden); + } + }, observeChanges: function() { if('MutationObserver' in window) { diff --git a/src/definitions/modules/checkbox.less b/src/definitions/modules/checkbox.less index cd4e768c4..c076057de 100755 --- a/src/definitions/modules/checkbox.less +++ b/src/definitions/modules/checkbox.less @@ -60,9 +60,9 @@ .ui.checkbox .box, .ui.checkbox label { + cursor: auto; position: relative; display: block; - cursor: pointer; padding-left: @labelDistance; outline: none; } @@ -115,10 +115,8 @@ /* Inside */ .ui.checkbox label, .ui.checkbox + label { - cursor: pointer; color: @labelColor; transition: @labelTransition; - user-select: none; } /* Outside */ @@ -263,6 +261,14 @@ z-index: -1; } +/* Selectable Label */ +.ui.checkbox input[type="checkbox"].hidden + label, +.ui.checkbox input[type="radio"].hidden + label { + cursor: pointer; + user-select: none; +} + + /*******************************