IconList: that. -> self.
This commit is contained in:
parent
e7f9279a9d
commit
4a9400cbd9
1 changed files with 27 additions and 27 deletions
|
@ -58,17 +58,17 @@ Ox.IconList = function(options, self) {
|
||||||
.options(options || {})
|
.options(options || {})
|
||||||
.update({
|
.update({
|
||||||
items: function() {
|
items: function() {
|
||||||
that.$element.options({items: self.options.items});
|
self.$list.options({items: self.options.items});
|
||||||
},
|
},
|
||||||
query: function() {
|
query: function() {
|
||||||
that.$element.options({query: self.options.query});
|
self.$list.options({query: self.options.query});
|
||||||
},
|
},
|
||||||
selected: function() {
|
selected: function() {
|
||||||
that.$element.options({selected: self.options.selected});
|
self.$list.options({selected: self.options.selected});
|
||||||
},
|
},
|
||||||
sort: function() {
|
sort: function() {
|
||||||
updateKeys();
|
updateKeys();
|
||||||
that.$element.options({sort: self.options.sort});
|
self.$list.options({sort: self.options.sort});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -91,8 +91,7 @@ Ox.IconList = function(options, self) {
|
||||||
self.itemWidth = self.options.size;
|
self.itemWidth = self.options.size;
|
||||||
self.itemHeight = self.iconHeight + self.options.size * 0.5;
|
self.itemHeight = self.iconHeight + self.options.size * 0.5;
|
||||||
|
|
||||||
that.setElement(
|
self.$list = Ox.List({
|
||||||
Ox.List({
|
|
||||||
centered: self.options.centered,
|
centered: self.options.centered,
|
||||||
// fixme: change all occurences of construct to render
|
// fixme: change all occurences of construct to render
|
||||||
construct: constructItem,
|
construct: constructItem,
|
||||||
|
@ -120,8 +119,9 @@ Ox.IconList = function(options, self) {
|
||||||
self.options.selected = data.ids;
|
self.options.selected = data.ids;
|
||||||
}
|
}
|
||||||
that.triggerEvent(event, data);
|
that.triggerEvent(event, data);
|
||||||
})
|
});
|
||||||
);
|
|
||||||
|
that.setElement(self.$list);
|
||||||
|
|
||||||
updateKeys();
|
updateKeys();
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ Ox.IconList = function(options, self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateKeys() {
|
function updateKeys() {
|
||||||
that.$element.options({
|
self.$list.options({
|
||||||
keys: Ox.unique(
|
keys: Ox.unique(
|
||||||
[self.options.sort[0].key].concat(self.options.keys)
|
[self.options.sort[0].key].concat(self.options.keys)
|
||||||
)
|
)
|
||||||
|
@ -165,7 +165,7 @@ Ox.IconList = function(options, self) {
|
||||||
() -> <o> the list
|
() -> <o> the list
|
||||||
@*/
|
@*/
|
||||||
that.closePreview = function() {
|
that.closePreview = function() {
|
||||||
that.$element.closePreview();
|
self.$list.closePreview();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -173,23 +173,23 @@ Ox.IconList = function(options, self) {
|
||||||
gainFocus <f> gainFocus
|
gainFocus <f> gainFocus
|
||||||
@*/
|
@*/
|
||||||
that.gainFocus = function() {
|
that.gainFocus = function() {
|
||||||
that.$element.gainFocus();
|
self.$list.gainFocus();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
that.getPasteIndex = function() {
|
that.getPasteIndex = function() {
|
||||||
return that.$element.getPasteIndex();
|
return self.$list.getPasteIndex();
|
||||||
};
|
};
|
||||||
|
|
||||||
/*@
|
/*@
|
||||||
hasFocus <f> hasFocus
|
hasFocus <f> hasFocus
|
||||||
@*/
|
@*/
|
||||||
that.hasFocus = function() {
|
that.hasFocus = function() {
|
||||||
return that.$element.hasFocus();
|
return self.$list.hasFocus();
|
||||||
};
|
};
|
||||||
|
|
||||||
that.invertSelection = function() {
|
that.invertSelection = function() {
|
||||||
that.$element.invertSelection();
|
self.$list.invertSelection();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -197,7 +197,7 @@ Ox.IconList = function(options, self) {
|
||||||
loseFocus <f> loseFocus
|
loseFocus <f> loseFocus
|
||||||
@*/
|
@*/
|
||||||
that.loseFocus = function() {
|
that.loseFocus = function() {
|
||||||
that.$element.loseFocus();
|
self.$list.loseFocus();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ Ox.IconList = function(options, self) {
|
||||||
openPreview <f> openPreview
|
openPreview <f> openPreview
|
||||||
@*/
|
@*/
|
||||||
that.openPreview = function() {
|
that.openPreview = function() {
|
||||||
that.$element.openPreview();
|
self.$list.openPreview();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ Ox.IconList = function(options, self) {
|
||||||
() -> <o> the list
|
() -> <o> the list
|
||||||
@*/
|
@*/
|
||||||
that.reloadList = function() {
|
that.reloadList = function() {
|
||||||
that.$element.reloadList();
|
self.$list.reloadList();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -223,22 +223,22 @@ Ox.IconList = function(options, self) {
|
||||||
() -> <o> the list
|
() -> <o> the list
|
||||||
@*/
|
@*/
|
||||||
that.scrollToSelection = function() {
|
that.scrollToSelection = function() {
|
||||||
that.$element.scrollToSelection();
|
self.$list.scrollToSelection();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
that.selectAll = function() {
|
that.selectAll = function() {
|
||||||
that.$element.selectAll();
|
self.$list.selectAll();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
that.selectPosition = function(pos) {
|
that.selectPosition = function(pos) {
|
||||||
that.$element.selectPosition(pos);
|
self.$list.selectPosition(pos);
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
that.selectSelected = function(offset) {
|
that.selectSelected = function(offset) {
|
||||||
that.$element.selectSelected(offset);
|
self.$list.selectSelected(offset);
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ Ox.IconList = function(options, self) {
|
||||||
() -> <n> size
|
() -> <n> size
|
||||||
@*/
|
@*/
|
||||||
that.size = function() {
|
that.size = function() {
|
||||||
that.$element.size();
|
self.$list.size();
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -264,7 +264,7 @@ Ox.IconList = function(options, self) {
|
||||||
operator: operator
|
operator: operator
|
||||||
}];
|
}];
|
||||||
updateKeys();
|
updateKeys();
|
||||||
that.$element.sortList(key, operator);
|
self.$list.sortList(key, operator);
|
||||||
return that;
|
return that;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -280,12 +280,12 @@ Ox.IconList = function(options, self) {
|
||||||
id = args.shift(),
|
id = args.shift(),
|
||||||
sort = false;
|
sort = false;
|
||||||
if (arguments.length == 1) {
|
if (arguments.length == 1) {
|
||||||
return that.$element.value(id);
|
return self.$list.value(id);
|
||||||
} else if (arguments.length == 2 && Ox.isString(arguments[1])) {
|
} else if (arguments.length == 2 && Ox.isString(arguments[1])) {
|
||||||
return that.$element.value(id, arguments[1]);
|
return self.$list.value(id, arguments[1]);
|
||||||
} else {
|
} else {
|
||||||
Ox.forEach(Ox.makeObject(args), function(value, key) {
|
Ox.forEach(Ox.makeObject(args), function(value, key) {
|
||||||
that.$element.value(id, key, value);
|
self.$list.value(id, key, value);
|
||||||
if (key == self.unique) {
|
if (key == self.unique) {
|
||||||
// unique id has changed
|
// unique id has changed
|
||||||
self.options.selected = self.options.selected.map(function(id_) {
|
self.options.selected = self.options.selected.map(function(id_) {
|
||||||
|
@ -298,7 +298,7 @@ Ox.IconList = function(options, self) {
|
||||||
sort = true;
|
sort = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
sort && that.$element.sort();
|
sort && self.$list.sort();
|
||||||
return that;
|
return that;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue