more list

This commit is contained in:
Rolux 2010-06-29 18:28:22 +02:00
parent 4dc02f48dc
commit 57342999c4

View File

@ -2767,14 +2767,13 @@ requires
})
.html(v.title)
.click(function() {
that.sort(v.id, self.options.sort[0].key == v.id ?
(self.options.sort[0].operator == "+" ? "-" : "+") : v.operator);
clickColumn(v)
})
.appendTo(that.$head.$content.$element);
$order = $("<div>")
.addClass("OxOrder")
.html(oxui.symbols["triangle_" + (
self.options.sort[0].operator == "+" ? "up" : "down"
v.operator == "+" ? "up" : "down"
)])
.click(function() {
$(this).prev().trigger("click")
@ -2847,6 +2846,13 @@ requires
}
function clickColumn(data) {
var isSelected = self.options.sort[0].key == data.id;
that.sort(
data.id, isSelected ? (self.options.sort[0].operator == "+" ? "-" : "+") : data.operator
);
}
function constructItem(data, pos) {
var $item = $("<div>")
.addClass("OxItem")
@ -2911,9 +2917,9 @@ requires
}
function toggleOrder(pos) {
self.options.columns[pos].operator = self.options.columns[pos].operator == "+" ? "-" : "+";
Ox.print("toggleOrder", pos, self.options.sort[0].operator)
that.$titles[pos].next().html(oxui.symbols[
"triangle" + self.options.columns[pos].operator == "+" ? "up" : "down"
"triangle_" + (self.options.sort[0].operator == "+" ? "up" : "down")
]);
}
@ -2925,28 +2931,29 @@ requires
that.$titles[pos].toggleClass("OxSelected");
that.$titles[pos].next().toggleClass("OxSelected");
that.$titles[pos].next().next().children().eq(0).toggleClass("OxSelected");
/*
that.$titles[pos].css({
width: (
that.$titles[pos].width() + pos == self.selectedColumn ? -16 : 16
that.$titles[pos].width() + (that.$titles[pos].hasClass("OxSelected") ? -16 : 16)
) + "px"
});
*/
}
that.sort = function(key, operator) {
if (key != self.options.sort.key || operator != self.options.sort.operator) {
var isSelected = key == self.options.sort[0].key;
self.options.sort = [
{
key: key,
operator: operator
}
];
if (isSelected) {
toggleOrder(self.selectedColumn);
} else {
toggleSelected(self.selectedColumn);
self.selectedColumn = getColumnById(key);
toggleSelected(self.selectedColumn);
that.$body.sort(self.options.sort[0].key, self.options.sort[0].operator);
}
that.$body.sort(self.options.sort[0].key, self.options.sort[0].operator);
};
return that;