2014-05-04 17:26:43 +00:00
|
|
|
'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});
|
2014-05-25 12:16:04 +00:00
|
|
|
},
|
|
|
|
oml_listview: function() {
|
|
|
|
that.updateElement();
|
2014-05-04 17:26:43 +00:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-05-25 12:16:04 +00:00
|
|
|
that.updateElement = function() {
|
|
|
|
return that.options({value: ui.listView});
|
|
|
|
};
|
|
|
|
|
2014-05-04 17:26:43 +00:00
|
|
|
return that;
|
|
|
|
|
|
|
|
};
|