Browse Source

Fixes #1954, input selector not specific enough

pull/2034/head
jlukic 9 years ago
parent
commit
7989d7e8d5
1 changed files with 7 additions and 6 deletions
  1. 13
      src/definitions/modules/checkbox.js

13
src/definitions/modules/checkbox.js

@ -41,7 +41,7 @@ $.fn.checkbox = function(parameters) {
moduleNamespace = 'module-' + namespace,
$module = $(this),
$label = $(this).find(selector.label).first(),
$label = $(this).find(selector.label),
$input = $(this).find(selector.input),
instance = $module.data(moduleNamespace),
@ -59,6 +59,8 @@ $.fn.checkbox = function(parameters) {
module.create.label();
module.add.events();
console.log($input);
if( module.is.checked() ) {
module.set.checked();
if(settings.fireOnInit) {
@ -93,9 +95,8 @@ $.fn.checkbox = function(parameters) {
},
refresh: function() {
$module = $(this);
$label = $(this).find(selector.label).first();
$input = $(this).find(selector.input);
$label = $module.find(selector.label);
$input = $module.find(selector.input);
},
observeChanges: function() {
@ -502,8 +503,8 @@ $.fn.checkbox.settings = {
},
selector : {
input : 'input[type="checkbox"], input[type="radio"]',
label : 'label'
input : '> input[type="checkbox"], > input[type="radio"]',
label : '> label'
}
};

Loading…
Cancel
Save