openmedialibrary/static/js/folderList.js

68 lines
2.1 KiB
JavaScript
Raw Normal View History

2014-05-04 17:26:43 +00:00
'use strict';
oml.ui.folderList = function(options) {
var ui = oml.user.ui,
that = Ox.TableList({
columns: [
{
format: function(value) {
return $('<img>')
.attr({
src: Ox.UI.getImageURL(
value == 'libraries' ? 'symbolData'
: value == 'library' ? 'symbolUser'
: value == 'static' ? 'symbolClick'
: 'symbolFind'
)
})
.css({
width: '10px',
height: '10px',
margin: '2px -2px 2px 0'
});
},
id: 'type',
visible: true,
width: 16
},
{
id: 'name',
visible: true,
2015-04-20 07:50:42 +00:00
width: ui.sidebarSize - 16 - 48,
2014-05-04 17:26:43 +00:00
},
{
align: 'right',
format: function(value) {
return value > -1
? '<span class="OxLight">'
+ Ox.formatNumber(value)
+ '</span>'
: '';
},
id: 'items',
visible: true,
2015-04-20 07:50:42 +00:00
width: 48
2014-05-04 17:26:43 +00:00
}
],
draggable: options.draggable,
2014-10-31 13:27:45 +00:00
items: Ox.clone(options.items, true),
2014-05-04 17:26:43 +00:00
sort: [{key: 'index', operator: '+'}],
sortable: options.sortable,
selected: [],
unique: 'id'
})
.css({
width: ui.sidebarSize + 'px',
height: '16px'
});
that.resizeElement = function() {
// ...
};
return that;
2014-10-31 13:27:45 +00:00
};