openmedialibrary/static/js/folderList.js

70 lines
2.2 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: [
{
2019-01-19 13:09:34 +00:00
format: function(value, data) {
2014-05-04 17:26:43 +00:00
return $('<img>')
.attr({
src: Ox.UI.getImageURL(
value == 'libraries' ? 'symbolData'
: value == 'library' ? 'symbolUser'
2019-01-19 13:09:34 +00:00
: data.name == 'Public' ? 'symbolPublish'
2014-05-04 17:26:43 +00:00
: value == 'static' ? 'symbolClick'
: 'symbolFind'
)
})
.css({
width: '10px',
height: '10px',
margin: '2px -2px 2px 0'
});
},
id: 'type',
visible: true,
width: 16
},
{
2016-01-08 08:37:34 +00:00
format: Ox.encodeHTMLEntities,
2014-05-04 17:26:43 +00:00
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
};