1
0
Fork 0
forked from 0x2620/oxjs

more docs

This commit is contained in:
j 2011-05-16 12:49:48 +02:00
commit cc75e25415
42 changed files with 664 additions and 93 deletions

View file

@ -1,4 +1,26 @@
// vim: et:ts=4:sw=4:sts=4:ft=js
/*@
Ox.Select <f:Ox.Element> Select Object
() -> <f> Select Object
(options) -> <f> Select Object
(options, self) -> <f> Select Object
options <o> Options object
id <s> element id
items <a|[]> items
max <n|1> minimum number of selected items
min <n|1> maximum number of selected items
overlap <s|'none'> can be none, left or right
selectable <b|true> is selectable
size <s|'medium'> size, can be small, medium, large
title <s|''> select title
type <s|'text'> can be 'text' or 'image'
width <s|n|'auto'> can be auto or width in pixels
self <o> shared private variable
click <!> on click event
change <!> on change event
@*/
Ox.Select = function(options, self) {
// fixme: selected item needs attribute "checked", not "selected" ... that's strange
@ -130,6 +152,10 @@ Ox.Select = function(options, self) {
};
/*@
selectItem <f> select item in group
() -> <o> returns object of selected items with id, title
@*/
that.selected = function() {
return $.map(/*self.checked*/self.optionGroup.checked(), function(v) {
return {
@ -139,6 +165,11 @@ Ox.Select = function(options, self) {
});
};
/*@
selectItem <f> select item in group
(id) -> <u> select item by id
id <s> item id
@*/
that.selectItem = function(id) {
//Ox.print('selectItem', id, Ox.getObjectById(self.options.items, id).title)
self.options.type == 'text' && self.$title.html(