filters and folders

This commit is contained in:
Jan Gerber 2015-04-20 09:50:42 +02:00
parent 6eb08bd464
commit 4ecaeb6d4a
3 changed files with 18 additions and 8 deletions

View file

@ -17,7 +17,7 @@ oml.ui.filter = function(id) {
operator: '+', operator: '+',
title: Ox._(filter.title), title: Ox._(filter.title),
visible: true, visible: true,
width: filterSize - 44 - Ox.UI.SCROLLBAR_SIZE width: filterSize - 48 - Ox.UI.SCROLLBAR_SIZE
}, },
{ {
align: 'right', align: 'right',
@ -28,7 +28,7 @@ oml.ui.filter = function(id) {
operator: '-', operator: '-',
title: '#', title: '#',
visible: true, visible: true,
width: 44 width: 48
} }
], ],
columnsVisible: true, columnsVisible: true,
@ -157,10 +157,20 @@ oml.ui.filter = function(id) {
}) })
.bindEvent({ .bindEvent({
change: function(data) { change: function(data) {
var isOuter = filterIndex % 4 == 0, id = data.checked[0].id;
ui.filters[filterIndex] = Ox.getObjectById(oml.config.user.ui.filters, id);
ui._filterState = oml.getFilterState(ui.find);
oml.$ui[isOuter ? 'filtersOuterPanel' : 'filtersInnerPanel'].replaceElement(
isOuter ? filterIndex / 2 : filterIndex - 1,
oml.$ui.filters[filterIndex] = oml.ui.filter(id)
);
}, },
click: function(data) { click: function(data) {
if (data.id == 'clearFilter') {
that.options({selected: []}).triggerEvent('select', {ids: []});
} else if (data.id == 'clearFilters') {
oml.clearFilters();
}
} }
}) })
.appendTo(that.$bar.$element); .appendTo(that.$bar.$element);
@ -184,4 +194,4 @@ oml.ui.filter = function(id) {
return that; return that;
}; };

View file

@ -30,7 +30,7 @@ oml.ui.folderList = function(options) {
{ {
id: 'name', id: 'name',
visible: true, visible: true,
width: ui.sidebarSize - 58, width: ui.sidebarSize - 16 - 48,
}, },
{ {
align: 'right', align: 'right',
@ -43,7 +43,7 @@ oml.ui.folderList = function(options) {
}, },
id: 'items', id: 'items',
visible: true, visible: true,
width: 42 width: 48
} }
], ],
draggable: options.draggable, draggable: options.draggable,

View file

@ -951,7 +951,7 @@ oml.resizeFilters = function() {
oml.resizeListFolders = function() { oml.resizeListFolders = function() {
// FIXME: does this have to be here? // FIXME: does this have to be here?
var width = oml.getListFoldersWidth(), var width = oml.getListFoldersWidth(),
columnWidth = width - 58; columnWidth = width - 16 - 48;
oml.$ui.librariesList oml.$ui.librariesList
.css({width: width + 'px'}) .css({width: width + 'px'})
.resizeColumn('name', columnWidth); .resizeColumn('name', columnWidth);