Files
CouchPotatoServer/couchpotato/static/scripts/block/more.js
T
Ruud 18510cbd38 More menu styling
Logs link fix
2012-03-05 07:50:49 +01:00

54 lines
1.0 KiB
JavaScript

Block.More = new Class({
Extends: BlockBase,
create: function(){
var self = this;
self.el = new Element('div.more_menu').adopt(
self.more_option_ul = new Element('ul').adopt(
new Element('li').adopt(
new Element('a.orange', {
'text': 'Restart',
'events': {
'click': App.restart.bind(App)
}
})
),
new Element('li').adopt(
new Element('a.red', {
'text': 'Shutdown',
'events': {
'click': App.shutdown.bind(App)
}
})
)
),
new Element('a.button.onlay', {
'events': {
'click': function(){
self.el.toggleClass('show')
if(self.el.hasClass('show'))
this.addEvent('outerClick', function(){
self.el.removeClass('show')
this.removeEvents('outerClick');
})
else
this.removeEvents('outerClick');
}
}
})
)
},
addLink: function(tab, position){
var self = this
return new Element('li').adopt(tab).inject(self.more_option_ul, position || 'bottom')
}
});