in table list column heads, use images to indicate order, not buttons

This commit is contained in:
rolux 2012-12-29 13:56:04 +01:00
parent a9c026f6db
commit 100775b109

View file

@ -410,7 +410,7 @@ Ox.TableList = function(options, self) {
self.$heads = []; self.$heads = [];
self.$titles = []; self.$titles = [];
self.$titleImages = []; self.$titleImages = [];
self.$orderButtons = []; self.$orderImages = [];
self.visibleColumns.forEach(function(column, i) { self.visibleColumns.forEach(function(column, i) {
var $resize; var $resize;
self.$heads[i] = Ox.Element() self.$heads[i] = Ox.Element()
@ -461,15 +461,15 @@ Ox.TableList = function(options, self) {
self.$titles[i].html(column.title); self.$titles[i].html(column.title);
} }
if (column.operator) { if (column.operator) {
self.$orderButtons[i] = Ox.Button({ self.$orderImages[i] = $('<img>')
selectable: true, .attr({
style: 'symbol', src: Ox.UI.getImageURL(
title: column.operator == '+' ? 'up' : 'down', 'symbol' + (column.operator == '+' ? 'Up' : 'Down'),
type: 'image', 'selected'
value: true )
}) })
.addClass('OxOrder') .addClass('OxOrder')
.css({marginTop: (column.operator == '+' ? 1 : -1) + 'px'}) .css({marginTop: (column.operator == '+' ? 3 : 2) + 'px'})
.click(function() { .click(function() {
$(this).parent().trigger('click'); $(this).parent().trigger('click');
}) })
@ -923,10 +923,13 @@ Ox.TableList = function(options, self) {
var operator = self.options.sort[0].operator, var operator = self.options.sort[0].operator,
pos = getColumnPositionById(id); pos = getColumnPositionById(id);
if (pos > -1) { if (pos > -1) {
self.$orderButtons[pos].options({ self.$orderImages[pos].attr({
title: operator == '+' ? 'up' : 'down' src: Ox.UI.getImageURL(
'symbol' + (operator == '+' ? 'Up' : 'Down'),
'selected'
)
}).css({ }).css({
marginTop: (operator == '+' ? 1 : -1) + 'px' marginTop: (operator == '+' ? 3 : 2) + 'px'
}); });
} }
} }