This commit is contained in:
Rolux 2010-06-29 15:10:13 +02:00
parent e7d2a5de0a
commit a2c7bae121

View File

@ -2762,11 +2762,8 @@ requires
}) })
.html(v.title) .html(v.title)
.click(function() { .click(function() {
if (self.options.sort[0].key != v.id) { that.sort(v.id, self.options.sort[0].key == v.id ?
that.sort(v.id, v.operator); (self.options.sort[0].operator == "+" ? "-" : "+") : v.operator);
} else {
that.order(self.options.operator == "+" ? "-" : "+");
}
}) })
.appendTo(that.$head.$content.$element); .appendTo(that.$head.$content.$element);
$order = $("<div>") $order = $("<div>")
@ -2934,14 +2931,16 @@ requires
that.sort = function(key, operator) { that.sort = function(key, operator) {
if (key != self.options.sort.key || operator != self.options.sort.operator) { if (key != self.options.sort.key || operator != self.options.sort.operator) {
self.options.sort = { self.options.sort = [
key: key, {
operator: operator key: key,
}; operator: operator
}
];
toggleSelected(self.selectedColumn); toggleSelected(self.selectedColumn);
selectedColumn = getColumnById(key); self.selectedColumn = getColumnById(key);
toggleSelected(self.selectedColumn); toggleSelected(self.selectedColumn);
that.$body.sort(self.options.sort.key, self.options.sort.operator); that.$body.sort(self.options.sort[0].key, self.options.sort[0].operator);
} }
}; };
@ -3619,7 +3618,7 @@ requires
left = offset.left + self.options.offset.left + (self.options.side == "bottom" ? 0 : width), left = offset.left + self.options.offset.left + (self.options.side == "bottom" ? 0 : width),
top = offset.top + self.options.offset.top + (self.options.side == "bottom" ? height : 0), top = offset.top + self.options.offset.top + (self.options.side == "bottom" ? height : 0),
menuHeight = that.$content.outerHeight(); // fixme: why is outerHeight 0 when hidden? menuHeight = that.$content.outerHeight(); // fixme: why is outerHeight 0 when hidden?
menuMaxHeight = Math.floor($window.height() - top - 16), menuMaxHeight = Math.floor($window.height() - top - 16);
if (self.options.parent) { if (self.options.parent) {
if (menuHeight > menuMaxHeight) { if (menuHeight > menuMaxHeight) {
top = Ox.limit(top - menuHeight + menuMaxHeight, self.options.parent.offset().top, top); top = Ox.limit(top - menuHeight + menuMaxHeight, self.options.parent.offset().top, top);