69 lines
2.2 KiB
JavaScript
69 lines
2.2 KiB
JavaScript
'use strict';
|
|
|
|
oml.ui.folderList = function(options) {
|
|
|
|
var ui = oml.user.ui,
|
|
|
|
that = Ox.TableList({
|
|
columns: [
|
|
{
|
|
format: function(value, data) {
|
|
return $('<img>')
|
|
.attr({
|
|
src: Ox.UI.getImageURL(
|
|
value == 'libraries' ? 'symbolData'
|
|
: value == 'library' ? 'symbolUser'
|
|
: data.name == 'Public' ? 'symbolPublish'
|
|
: value == 'static' ? 'symbolClick'
|
|
: 'symbolFind'
|
|
)
|
|
})
|
|
.css({
|
|
width: '10px',
|
|
height: '10px',
|
|
margin: '2px -2px 2px 0'
|
|
});
|
|
},
|
|
id: 'type',
|
|
visible: true,
|
|
width: 16
|
|
},
|
|
{
|
|
format: Ox.encodeHTMLEntities,
|
|
id: 'name',
|
|
visible: true,
|
|
width: ui.sidebarSize - 16 - 48,
|
|
},
|
|
{
|
|
align: 'right',
|
|
format: function(value) {
|
|
return value > -1
|
|
? '<span class="OxLight">'
|
|
+ Ox.formatNumber(value)
|
|
+ '</span>'
|
|
: '';
|
|
},
|
|
id: 'items',
|
|
visible: true,
|
|
width: 48
|
|
}
|
|
],
|
|
draggable: options.draggable,
|
|
items: Ox.clone(options.items, true),
|
|
sort: [{key: 'index', operator: '+'}],
|
|
sortable: options.sortable,
|
|
selected: [],
|
|
unique: 'id'
|
|
})
|
|
.css({
|
|
width: ui.sidebarSize + 'px',
|
|
height: '16px'
|
|
});
|
|
|
|
that.resizeElement = function() {
|
|
// ...
|
|
};
|
|
|
|
return that;
|
|
|
|
};
|