|
|
@ -59,18 +59,7 @@ $.fn.checkbox = function(parameters) { |
|
|
|
module.create.label(); |
|
|
|
module.add.events(); |
|
|
|
|
|
|
|
if( module.is.checked() ) { |
|
|
|
module.set.checked(); |
|
|
|
if(settings.fireOnInit) { |
|
|
|
settings.onChecked.call($input.get()); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
module.remove.checked(); |
|
|
|
if(settings.fireOnInit) { |
|
|
|
settings.onUnchecked.call($input.get()); |
|
|
|
} |
|
|
|
} |
|
|
|
module.setup(); |
|
|
|
module.observeChanges(); |
|
|
|
|
|
|
|
module.instantiate(); |
|
|
@ -92,6 +81,23 @@ $.fn.checkbox = function(parameters) { |
|
|
|
; |
|
|
|
}, |
|
|
|
|
|
|
|
setup: function() { |
|
|
|
if( module.is.checked() ) { |
|
|
|
module.debug('Setting initial value to checked'); |
|
|
|
module.set.checked(); |
|
|
|
if(settings.fireOnInit) { |
|
|
|
settings.onChecked.call($input.get()); |
|
|
|
} |
|
|
|
} |
|
|
|
else { |
|
|
|
module.debug('Setting initial value to unchecked'); |
|
|
|
module.remove.checked(); |
|
|
|
if(settings.fireOnInit) { |
|
|
|
settings.onUnchecked.call($input.get()); |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
refresh: function() { |
|
|
|
$label = $module.find(selector.label); |
|
|
|
$input = $module.find(selector.input); |
|
|
|