diff --git a/build/js/ox.ui.js b/build/js/ox.ui.js index 712e7c86..73d541bd 100644 --- a/build/js/ox.ui.js +++ b/build/js/ox.ui.js @@ -2803,7 +2803,7 @@ requires $right = $("
").addClass("OxRight").appendTo($resize); }); that.$head.$content.css({ - width: Ox.sum(self.columnWidths) + "px" + width: (Ox.sum(self.columnWidths) + 2) + "px" }); toggleSelected(self.selectedColumn); that.$titles[self.selectedColumn].css({ @@ -2916,18 +2916,9 @@ requires that.sort(args.columns[pos].id, args.columns[pos].operator); } - function toggleOrder(pos) { - Ox.print("toggleOrder", pos, self.options.sort[0].operator) - that.$titles[pos].next().html(oxui.symbols[ - "triangle_" + (self.options.sort[0].operator == "+" ? "up" : "down") - ]); - } - function toggleSelected(pos) { - Ox.print("toggleSelected", pos) - if (pos > 0) { - that.$titles[pos].prev().children().eq(2).toggleClass("OxSelected"); - } + updateOrder(pos); + pos > 0 && that.$titles[pos].prev().children().eq(2).toggleClass("OxSelected"); that.$titles[pos].toggleClass("OxSelected"); that.$titles[pos].next().toggleClass("OxSelected"); that.$titles[pos].next().next().children().eq(0).toggleClass("OxSelected"); @@ -2938,6 +2929,12 @@ requires }); } + function updateOrder(pos) { + that.$titles[pos].next().html(oxui.symbols[ + "triangle_" + (self.options.sort[0].operator == "+" ? "up" : "down") + ]); + } + that.sort = function(key, operator) { var isSelected = key == self.options.sort[0].key; self.options.sort = [ @@ -2947,7 +2944,7 @@ requires } ]; if (isSelected) { - toggleOrder(self.selectedColumn); + updateOrder(self.selectedColumn); } else { toggleSelected(self.selectedColumn); self.selectedColumn = getColumnById(key);