From 7989d7e8d58317e0936f6bc1cef9b1fce25f2367 Mon Sep 17 00:00:00 2001 From: jlukic Date: Mon, 16 Mar 2015 14:47:17 -0400 Subject: [PATCH] Fixes #1954, input selector not specific enough --- src/definitions/modules/checkbox.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/definitions/modules/checkbox.js b/src/definitions/modules/checkbox.js index 19f7ae2de..e34ebde57 100644 --- a/src/definitions/modules/checkbox.js +++ b/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' } };