Updated toggle and moved to view inheritance

This commit is contained in:
Max Lynch
2013-11-08 17:57:04 -06:00
parent 6058afeb51
commit c73cc43c21
7 changed files with 74 additions and 71 deletions

View File

@ -1,14 +1,13 @@
(function(ionic) {
'use strict';
ionic.views.Toggle = function(opts) {
this.el = opts.el;
this.checkbox = opts.checkbox;
this.handle = opts.handle;
this.openPercent = -1;
};
ionic.views.Toggle.prototype = {
ionic.views.Toggle = ionic.views.View.inherit({
initialize: function(opts) {
this.el = opts.el;
this.checkbox = opts.checkbox;
this.handle = opts.handle;
this.openPercent = -1;
},
tap: function(e) {
this.val( !this.checkbox.checked );
@ -59,6 +58,6 @@
return this.checkbox.checked;
}
};
});
})(ionic);