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,4 +1,26 @@
|
|||
// vim: et:ts=4:sw=4:sts=4:ft=js
|
||||
/*@
|
||||
Ox.IconList <f:Ox.Element> IconList Object
|
||||
() -> <f> IconList Object
|
||||
(options) -> <f> IconList Object
|
||||
(options, self) -> <f> IconList Object
|
||||
options <o> Options object
|
||||
centerSelection <b|false> scroll list so selection is always centered
|
||||
draggable <b|true> can be dragged
|
||||
id <s|''> element id
|
||||
item <f|null> called with data, sort, size,
|
||||
extends data with information needed for Ox.IconItem
|
||||
items <f|null> items array or callback function
|
||||
keys <a|[]> available item keys
|
||||
max <n|-1> maximum selected selected items
|
||||
min <n|0> minimum of selcted items
|
||||
orientation <s|both> list orientation
|
||||
selected <a|[]> array of selected items
|
||||
size <n|128> list size
|
||||
sort <a|[]> sort keys
|
||||
self <o> shared private variable
|
||||
@*/
|
||||
|
||||
Ox.IconList = function(options, self) {
|
||||
|
||||
var self = self || {},
|
||||
|
|
@ -81,6 +103,10 @@ Ox.IconList = function(options, self) {
|
|||
});
|
||||
}
|
||||
|
||||
/*@
|
||||
setOption <f> set key/value
|
||||
(key, value) -> <u> set eky in options to value
|
||||
@*/
|
||||
self.setOption = function(key, value) {
|
||||
if (key == 'items') {
|
||||
that.$element.options(key, value);
|
||||
|
|
@ -91,28 +117,53 @@ Ox.IconList = function(options, self) {
|
|||
}
|
||||
}
|
||||
|
||||
/*@
|
||||
closePreview <f> close preview
|
||||
() -> <u> close
|
||||
@*/
|
||||
that.closePreview = function() {
|
||||
that.$element.closePreview();
|
||||
};
|
||||
|
||||
/*@
|
||||
paste <f> paste to list
|
||||
(data) -> <f> paste data, returns IconList
|
||||
@*/
|
||||
that.paste = function(data) {
|
||||
that.$element.paste(data);
|
||||
return that;
|
||||
};
|
||||
|
||||
/*@
|
||||
reloadList <f> reload list
|
||||
() -> <u> reload iconlist
|
||||
@*/
|
||||
that.reloadList = function() {
|
||||
that.$element.reloadList();
|
||||
return that;
|
||||
};
|
||||
|
||||
/*@
|
||||
scrollToSelection <f> set key/value
|
||||
() -> <u> scroll list ot selection
|
||||
@*/
|
||||
that.scrollToSelection = function() {
|
||||
that.$element.scrollToSelection();
|
||||
};
|
||||
|
||||
/*@
|
||||
size <f> set key/value
|
||||
() -> <n> get size of list
|
||||
@*/
|
||||
that.size = function() {
|
||||
that.$element.size();
|
||||
};
|
||||
|
||||
/*@
|
||||
sortList <f> sort list
|
||||
(key, operator) -> <u> sort list by key with operator
|
||||
operator <s> can be + / -
|
||||
@*/
|
||||
that.sortList = function(key, operator) {
|
||||
self.options.sort = [{
|
||||
key: key,
|
||||
|
|
@ -122,6 +173,12 @@ Ox.IconList = function(options, self) {
|
|||
that.$element.sortList(key, operator);
|
||||
};
|
||||
|
||||
/*@
|
||||
value <f> get/set value of item in list
|
||||
(id) -> <o> get all data for item
|
||||
(id, key) -> <s> get value of key of item with id
|
||||
(id, key, value) -> <f> set value, returns IconList
|
||||
@*/
|
||||
that.value = function(id, key, value) {
|
||||
// fixme: make this accept id, {k: v, ...}
|
||||
if (arguments.length == 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue