forked from 0x2620/oxjs
more docs
This commit is contained in:
parent
bdb8d98787
commit
cc75e25415
42 changed files with 664 additions and 93 deletions
|
|
@ -1,22 +1,21 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||
Ox.Checkbox = function(options, self) {
|
||||
/*@
|
||||
Ox.Checkbox <f:Ox.Element> Checkbox Element
|
||||
() -> <f> Checkbox Element
|
||||
(options) -> <f> Checkbox Element
|
||||
(options, self) -> <f> Checkbox Element
|
||||
options <o> Options object
|
||||
disabled <b> if true, checkbox is disabled
|
||||
id <s> element id
|
||||
group <b> if true, checkbox is part of a group
|
||||
checked <b> if true, checkbox is checked
|
||||
title <s> text on label
|
||||
width <n> width in px
|
||||
self <o> Shared private variable
|
||||
change <!> triggered when checked property changes, passes {checked, id, title}
|
||||
@*/
|
||||
|
||||
/**
|
||||
options
|
||||
disabled boolean, if true, checkbox is disabled
|
||||
id element id
|
||||
group boolean, if true, checkbox is part of a group
|
||||
checked boolean, if true, checkbox is checked
|
||||
title string, text on label
|
||||
width integer, width in px
|
||||
methods:
|
||||
toggleChecked function()
|
||||
toggles checked property
|
||||
returns that
|
||||
events:
|
||||
change triggered when checked property changes
|
||||
passes {checked, id, title}
|
||||
*/
|
||||
Ox.Checkbox = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element({}, self)
|
||||
|
|
@ -91,10 +90,18 @@ Ox.Checkbox = function(options, self) {
|
|||
}
|
||||
};
|
||||
|
||||
/*@
|
||||
checked <f> get current checked state
|
||||
() -> <b> returns self.options.checked
|
||||
@*/
|
||||
that.checked = function() {
|
||||
return self.options.checked;
|
||||
}
|
||||
|
||||
/*@
|
||||
toggleChecked <f> toggle current checked state
|
||||
() -> <f> toggle state, returns Checkbox Element
|
||||
@*/
|
||||
that.toggleChecked = function() {
|
||||
self.$button.toggleTitle();
|
||||
return that;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue