pandora/static/js/pandora/sectionButtons.js

32 lines
1,007 B
JavaScript
Raw Normal View History

2011-07-29 18:37:11 +00:00
// vim: et:ts=4:sw=4:sts=4:ft=javascript
2011-11-05 17:04:10 +00:00
'use strict';
2011-05-25 19:42:45 +00:00
pandora.ui.sectionButtons = function() {
2011-06-19 17:49:25 +00:00
var that = Ox.ButtonGroup({
2011-05-25 19:42:45 +00:00
buttons: [
2011-12-22 07:27:48 +00:00
{id: 'items', title: pandora.site.itemName.plural},
{id: 'edits', title: 'Edits', disabled: true},
{id: 'texts', title: 'Texts', disabled: true}
2011-05-25 19:42:45 +00:00
],
id: 'sectionButtons',
2011-12-22 07:27:48 +00:00
selectable: true,
value: pandora.user.ui.section
2011-05-25 19:42:45 +00:00
}).css({
float: 'left',
margin: '4px'
})
.bindEvent({
2011-09-17 17:40:15 +00:00
change: function(data) {
2011-12-21 15:34:28 +00:00
var section = data.value;
2011-09-01 04:46:44 +00:00
if (section == 'items') {
2011-05-25 19:42:45 +00:00
pandora.URL.set(pandora.Query.toString());
2011-09-01 04:46:44 +00:00
} else if (section == 'clips') {
pandora.URL.set('clips');
2011-05-28 11:18:28 +00:00
} else if (section == 'texts') {
pandora.URL.set('texts');
2011-05-25 19:42:45 +00:00
}
}
});
return that;
};