fix a bug where in info list, the value of the sort key would not be requested when changing the sort order of the list (fixes #747)
This commit is contained in:
parent
a56329064d
commit
374508a9f1
2 changed files with 14 additions and 9 deletions
|
@ -65,7 +65,8 @@ 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.$element = Ox.List({
|
that.setElement(
|
||||||
|
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,
|
||||||
|
@ -89,7 +90,8 @@ Ox.IconList = function(options, self) {
|
||||||
select: function() {
|
select: function() {
|
||||||
self.options.selected = that.$element.options('selected');
|
self.options.selected = that.$element.options('selected');
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
);
|
||||||
|
|
||||||
updateKeys();
|
updateKeys();
|
||||||
|
|
||||||
|
@ -141,7 +143,6 @@ Ox.IconList = function(options, self) {
|
||||||
} else if (key == 'sort') {
|
} else if (key == 'sort') {
|
||||||
updateKeys();
|
updateKeys();
|
||||||
that.$element.options(key, value);
|
that.$element.options(key, value);
|
||||||
//that.$element.sortList(key, operator);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,12 +21,13 @@ Ox.InfoList = function(options, self) {
|
||||||
})
|
})
|
||||||
.options(options || {})
|
.options(options || {})
|
||||||
|
|
||||||
Ox.print('INFO LIST FIND', self.options.find);
|
//Ox.print('INFO LIST FIND', self.options.find);
|
||||||
|
|
||||||
self.iconSize = Math.round(self.options.size * 2/3);
|
self.iconSize = Math.round(self.options.size * 2/3);
|
||||||
self.itemHeight = self.options.size;
|
self.itemHeight = self.options.size;
|
||||||
|
|
||||||
that.$element = Ox.List({
|
that.setElement(
|
||||||
|
Ox.List({
|
||||||
construct: constructItem,
|
construct: constructItem,
|
||||||
draggable: self.options.draggable,
|
draggable: self.options.draggable,
|
||||||
id: self.options.id,
|
id: self.options.id,
|
||||||
|
@ -48,7 +49,8 @@ Ox.InfoList = function(options, self) {
|
||||||
select: function() {
|
select: function() {
|
||||||
self.options.selected = that.$element.options('selected');
|
self.options.selected = that.$element.options('selected');
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
);
|
||||||
|
|
||||||
updateKeys();
|
updateKeys();
|
||||||
|
|
||||||
|
@ -139,9 +141,11 @@ Ox.InfoList = function(options, self) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateKeys() {
|
function updateKeys() {
|
||||||
self.options.keys = Ox.unique(Ox.merge(self.options.keys, [self.options.sort[0].key]));
|
|
||||||
that.$element.options({
|
that.$element.options({
|
||||||
keys: self.options.keys
|
keys: Ox.unique(Ox.merge(
|
||||||
|
self.options.sort[0].key,
|
||||||
|
self.options.keys
|
||||||
|
))
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -149,9 +153,9 @@ Ox.InfoList = function(options, self) {
|
||||||
if (key == 'items') {
|
if (key == 'items') {
|
||||||
that.$element.options(key, value);
|
that.$element.options(key, value);
|
||||||
} else if (key == 'selected') {
|
} else if (key == 'selected') {
|
||||||
Ox.Log('List', 'SELECTED', value)
|
|
||||||
that.$element.options(key, value);
|
that.$element.options(key, value);
|
||||||
} else if (key == 'sort') {
|
} else if (key == 'sort') {
|
||||||
|
updateKeys();
|
||||||
that.$element.options(key, value);
|
that.$element.options(key, value);
|
||||||
} else if (key == 'width') {
|
} else if (key == 'width') {
|
||||||
var width = getItemWidth();
|
var width = getItemWidth();
|
||||||
|
|
Loading…
Reference in a new issue