openmedialibrary/static/js/listViewButtons.js
2014-05-12 04:09:31 +02:00

29 lines
No EOL
677 B
JavaScript

'use strict';
oml.ui.listViewButtons = function() {
var ui = oml.user.ui,
that = Ox.ButtonGroup({
buttons: oml.config.listViews.map(function(view) {
return Ox.extend({
tooltip: Ox._('View as') + ' ' + view.title
}, view);
}),
selectable: true,
style: 'squared',
type: 'image',
value: ui.listView
}).css({
float: 'left',
margin: '4px 2px'
})
.bindEvent({
change: function(data) {
oml.UI.set({listView: data.value});
}
});
return that;
};