forked from 0x2620/oxjs
some documentation
This commit is contained in:
parent
275dcbb356
commit
bdb8d98787
45 changed files with 775 additions and 255 deletions
|
|
@ -1,18 +1,29 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||
/*@
|
||||
Ox.Button <f:Ox.Element> Button Object
|
||||
() -> <f> Button Object
|
||||
(options) -> <f> Button Object
|
||||
(options, self) -> <f> Button Object
|
||||
options <o> Options object
|
||||
disabled <b|false> disabled
|
||||
group <b|false> is part of group
|
||||
id: <s|''> button id
|
||||
overlap <s|none> overlap
|
||||
selectable <b|false> is selecatable
|
||||
selected <b|false> is selected
|
||||
size <s|medium> button size
|
||||
style <s|default> // can be default, checkbox, symbol, or tab
|
||||
title <s|a|''> title, can be array of titles
|
||||
tooltip <s|a|''> tooltip if multiple must be same number as titles
|
||||
type <s|text> button type, text or image, (for image, title must be symbolTitle.svg must be availabe)
|
||||
width <s|auto> button width
|
||||
self <o> Shared private variable
|
||||
click <!> non-selectable button was clicked
|
||||
deselect <!> selectable button was deselected
|
||||
select <!> selectable button was selected
|
||||
@*/
|
||||
|
||||
Ox.Button = function(options, self) {
|
||||
|
||||
/**
|
||||
methods:
|
||||
toggleDisabled enable/disable button
|
||||
toggleSelected select/unselect button
|
||||
toggleTitle if more than one title was provided,
|
||||
toggle to next title.
|
||||
events:
|
||||
click non-selectable button was clicked
|
||||
deselect selectable button was deselected
|
||||
select selectable button was selected
|
||||
*/
|
||||
|
||||
var self = self || {},
|
||||
that = new Ox.Element('<input>', self)
|
||||
.defaults({
|
||||
|
|
@ -137,6 +148,10 @@ Ox.Button = function(options, self) {
|
|||
}
|
||||
}
|
||||
|
||||
/*@
|
||||
toggleDisabled <f>
|
||||
() -> <u> toggle disabled state
|
||||
@*/
|
||||
that.toggleDisabled = function() {
|
||||
that.options({
|
||||
enabled: !self.options.disabled
|
||||
|
|
@ -144,6 +159,10 @@ Ox.Button = function(options, self) {
|
|||
//self.options.disabled = !self.options.disabled;
|
||||
}
|
||||
|
||||
/*@
|
||||
toggleSelected <f>
|
||||
() -> <u> toggle selected state
|
||||
@*/
|
||||
that.toggleSelected = function() {
|
||||
that.options({
|
||||
selected: !self.options.selected
|
||||
|
|
@ -151,6 +170,10 @@ Ox.Button = function(options, self) {
|
|||
//self.options.selected = !self.options.selected;
|
||||
}
|
||||
|
||||
/*@
|
||||
toggleTitle <f>
|
||||
() -> <u> toggle through titles
|
||||
@*/
|
||||
that.toggleTitle = function() {
|
||||
self.selectedTitle = 1 - self.selectedTitle;
|
||||
setTitle(self.titles[self.selectedTitle].title);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue