in table list column heads, use images to indicate order, not buttons
This commit is contained in:
parent
a9c026f6db
commit
100775b109
1 changed files with 14 additions and 11 deletions
|
@ -410,7 +410,7 @@ Ox.TableList = function(options, self) {
|
|||
self.$heads = [];
|
||||
self.$titles = [];
|
||||
self.$titleImages = [];
|
||||
self.$orderButtons = [];
|
||||
self.$orderImages = [];
|
||||
self.visibleColumns.forEach(function(column, i) {
|
||||
var $resize;
|
||||
self.$heads[i] = Ox.Element()
|
||||
|
@ -461,15 +461,15 @@ Ox.TableList = function(options, self) {
|
|||
self.$titles[i].html(column.title);
|
||||
}
|
||||
if (column.operator) {
|
||||
self.$orderButtons[i] = Ox.Button({
|
||||
selectable: true,
|
||||
style: 'symbol',
|
||||
title: column.operator == '+' ? 'up' : 'down',
|
||||
type: 'image',
|
||||
value: true
|
||||
self.$orderImages[i] = $('<img>')
|
||||
.attr({
|
||||
src: Ox.UI.getImageURL(
|
||||
'symbol' + (column.operator == '+' ? 'Up' : 'Down'),
|
||||
'selected'
|
||||
)
|
||||
})
|
||||
.addClass('OxOrder')
|
||||
.css({marginTop: (column.operator == '+' ? 1 : -1) + 'px'})
|
||||
.css({marginTop: (column.operator == '+' ? 3 : 2) + 'px'})
|
||||
.click(function() {
|
||||
$(this).parent().trigger('click');
|
||||
})
|
||||
|
@ -923,10 +923,13 @@ Ox.TableList = function(options, self) {
|
|||
var operator = self.options.sort[0].operator,
|
||||
pos = getColumnPositionById(id);
|
||||
if (pos > -1) {
|
||||
self.$orderButtons[pos].options({
|
||||
title: operator == '+' ? 'up' : 'down'
|
||||
self.$orderImages[pos].attr({
|
||||
src: Ox.UI.getImageURL(
|
||||
'symbol' + (operator == '+' ? 'Up' : 'Down'),
|
||||
'selected'
|
||||
)
|
||||
}).css({
|
||||
marginTop: (operator == '+' ? 1 : -1) + 'px'
|
||||
marginTop: (operator == '+' ? 3 : 2) + 'px'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue