mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-11-06 22:29:44 +08:00
26 lines
449 B
JavaScript
26 lines
449 B
JavaScript
|
|
(function(ionic) {
|
|
|
|
ionic.views.Checkbox = function(opts) {
|
|
this.el = opts.el;
|
|
this.checkbox = opts.checkbox;
|
|
this.handle = opts.handle;
|
|
};
|
|
|
|
ionic.views.Checkbox.prototype = {
|
|
|
|
tap: function(e) {
|
|
this.val( !this.checkbox.checked );
|
|
},
|
|
|
|
val: function(value) {
|
|
if(value === true || value === false) {
|
|
this.checkbox.checked = value;
|
|
}
|
|
return this.checkbox.checked;
|
|
}
|
|
|
|
};
|
|
|
|
})(ionic);
|