From a2c7bae121059b979e7b9aa378e2748e6d8c66b3 Mon Sep 17 00:00:00 2001 From: Rolux Date: Tue, 29 Jun 2010 15:10:13 +0200 Subject: [PATCH] typo --- build/js/ox.ui.js | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 548d242..2ae3f6e 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -2762,11 +2762,8 @@ requires }) .html(v.title) .click(function() { - if (self.options.sort[0].key != v.id) { - that.sort(v.id, v.operator); - } else { - that.order(self.options.operator == "+" ? "-" : "+"); - } + that.sort(v.id, self.options.sort[0].key == v.id ? + (self.options.sort[0].operator == "+" ? "-" : "+") : v.operator); }) .appendTo(that.$head.$content.$element); $order = $("
") @@ -2934,14 +2931,16 @@ requires that.sort = function(key, operator) { if (key != self.options.sort.key || operator != self.options.sort.operator) { - self.options.sort = { - key: key, - operator: operator - }; + self.options.sort = [ + { + key: key, + operator: operator + } + ]; toggleSelected(self.selectedColumn); - selectedColumn = getColumnById(key); + self.selectedColumn = getColumnById(key); 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), top = offset.top + self.options.offset.top + (self.options.side == "bottom" ? height : 0), 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 (menuHeight > menuMaxHeight) { top = Ox.limit(top - menuHeight + menuMaxHeight, self.options.parent.offset().top, top);