use themed mode colors for table list column head images

This commit is contained in:
rolux 2012-12-28 18:02:50 +01:00
parent 77905dc4ea
commit 2c2b680284

View file

@ -409,6 +409,7 @@ Ox.TableList = function(options, self) {
var pos;
self.$heads = [];
self.$titles = [];
self.$titleImages = [];
self.$orderButtons = [];
self.visibleColumns.forEach(function(column, i) {
var $resize;
@ -449,19 +450,23 @@ Ox.TableList = function(options, self) {
})
.appendTo(self.$heads[i]);
if (column.titleImage) {
self.$titles[i].append(
$('<img>').attr({
src: Ox.UI.getImageURL('symbol' + Ox.toTitleCase(column.titleImage))
self.$titleImages[i] = $('<img>').
attr({
src: Ox.UI.getImageURL(
'symbol' + Ox.toTitleCase(column.titleImage)
)
})
);
.appendTo(self.$titles[i]);
} else {
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'
type: 'image',
value: true
})
.addClass('OxOrder')
.css({marginTop: (column.operator == '+' ? 1 : -1) + 'px'})
@ -862,17 +867,27 @@ Ox.TableList = function(options, self) {
}
function toggleSelected(id) {
var pos = getColumnPositionById(id);
var isSelected,
pos = getColumnPositionById(id);
if (pos > -1) {
updateOrder(id);
pos > 0 && self.$heads[pos].prev().children().eq(2).toggleClass('OxSelected');
self.$heads[pos].toggleClass('OxSelected');
self.$heads[pos].next().children().eq(0).toggleClass('OxSelected');
isSelected = self.$heads[pos].hasClass('OxSelected');
self.$titles[pos].css({
width: self.$titles[pos].width()
+ (self.$heads[pos].hasClass('OxSelected') ? -16 : 16)
+ (isSelected ? -16 : 16)
+ 'px'
});
if (self.visibleColumns[pos].titleImage) {
self.$titleImages[pos].attr({
src: Ox.UI.getImageURL(
'symbol' + Ox.toTitleCase(self.visibleColumns[pos].titleImage),
isSelected ? 'selected' : ''
)
});
}
}
}