From c4cf3586df8933c9fc09b2cdb6dacf7f08d8387e Mon Sep 17 00:00:00 2001 From: rolux Date: Mon, 10 Dec 2012 17:44:52 +0100 Subject: [PATCH] TableList: set Select/Clear CSS according to scrollbar size --- source/Ox.UI/js/List/TableList.js | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/source/Ox.UI/js/List/TableList.js b/source/Ox.UI/js/List/TableList.js index 7264949b..0473e897 100644 --- a/source/Ox.UI/js/List/TableList.js +++ b/source/Ox.UI/js/List/TableList.js @@ -220,8 +220,21 @@ Ox.TableList = function(options, self) { return column.id; }) }) + .css(Ox.UI.SCROLLBAR_SIZE == 16 ? { + right: 0, + width: '14px' + } : { + right: '-1px', + width: '8px', + }) .bindEvent('change', changeColumns) .appendTo(that.$bar); + Ox.UI.SCROLLBAR_SIZE < 16 && $(that.$select.find('input')[0]).css({ + marginRight: '-3px', + marginTop: '1px', + width: '8px', + height: '8px' + }); } else if (self.options.clearButton) { self.$clearButton = Ox.Element({ element: '', @@ -229,8 +242,13 @@ Ox.TableList = function(options, self) { }) .addClass('OxClear') .attr({src: Ox.UI.getImageURL('symbolClose')}) - .css({ - right: Math.floor(Ox.UI.SCROLLBAR_SIZE - 8) / 2 + 'px' + .css(Ox.UI.SCROLLBAR_SIZE == 16 ? { + paddingLeft: '4px', + paddingRight: '2px', + marginRight: 0 + } : { + paddingRight: '1px', + marginRight: '-2px' }) [self.options.selected.length ? 'show' : 'hide']() .bindEvent({