Styling fixes
This commit is contained in:
@@ -15,19 +15,21 @@ Block.Menu = new Class({
|
||||
self.wrapper = new Element('div.wrapper').adopt(
|
||||
self.more_option_ul = new Element('ul')
|
||||
),
|
||||
new Element('a.button.onlay' + (self.options.button_class ? '.' + self.options.button_class : ''), {
|
||||
self.button = new Element('a.button' + (self.options.button_class ? '.' + self.options.button_class : ''), {
|
||||
'events': {
|
||||
'click': function(){
|
||||
self.el.toggleClass('show')
|
||||
self.fireEvent(self.el.hasClass('show') ? 'open' : 'close')
|
||||
|
||||
if(self.el.hasClass('show'))
|
||||
this.addEvent('outerClick', function(){
|
||||
self.el.removeClass('show')
|
||||
this.removeEvents('outerClick');
|
||||
if(self.el.hasClass('show')){
|
||||
self.el.addEvent('outerClick', self.removeOuterClick.bind(self))
|
||||
this.addEvent('outerClick', function(e){
|
||||
if(e.target.get('tag') != 'input')
|
||||
self.removeOuterClick()
|
||||
})
|
||||
}
|
||||
else
|
||||
this.removeEvents('outerClick');
|
||||
self.removeOuterClick()
|
||||
|
||||
}
|
||||
}
|
||||
@@ -36,6 +38,15 @@ Block.Menu = new Class({
|
||||
|
||||
},
|
||||
|
||||
removeOuterClick: function(){
|
||||
var self = this;
|
||||
|
||||
self.el.removeClass('show')
|
||||
self.el.removeEvents('outerClick');
|
||||
|
||||
self.button.removeEvents('outerClick');
|
||||
},
|
||||
|
||||
addLink: function(tab, position){
|
||||
var self = this;
|
||||
var el = new Element('li').adopt(tab).inject(self.more_option_ul, position || 'bottom');
|
||||
|
||||
@@ -67,12 +67,12 @@ Block.Navigation = new Class({
|
||||
if(!self.added){
|
||||
|
||||
new Element('li.separator').inject(self.nav);
|
||||
body.getElements('.header .more_menu.menu li a').each(function(el, nr){
|
||||
if([0, 1, 2, 5].indexOf(nr) > -1){
|
||||
self.nav.grab(
|
||||
new Element('li').grab(el.clone().cloneEvents(el))
|
||||
);
|
||||
}
|
||||
body.getElements('.header .more_menu.menu li a, .header .more_menu.menu li span.separator').each(function(el, nr){
|
||||
if(nr <= 2) return;
|
||||
if(el.get('tag') == 'a')
|
||||
self.nav.grab(new Element('li').grab(el.clone().cloneEvents(el)));
|
||||
else
|
||||
self.nav.grab(new Element('li.separator'));
|
||||
});
|
||||
|
||||
self.added = true;
|
||||
|
||||
@@ -68,28 +68,42 @@ var CouchPotato = new Class({
|
||||
self.block.footer = new Block.Footer(self, {})
|
||||
);
|
||||
|
||||
[new Element('a.orange', {
|
||||
'text': 'Restart',
|
||||
'events': {
|
||||
'click': self.restartQA.bind(self)
|
||||
}
|
||||
}),
|
||||
new Element('a.red', {
|
||||
'text': 'Shutdown',
|
||||
'events': {
|
||||
'click': self.shutdownQA.bind(self)
|
||||
}
|
||||
}),
|
||||
new Element('a', {
|
||||
'text': 'Update to latest',
|
||||
'events': {
|
||||
'click': self.checkForUpdate.bind(self, null)
|
||||
}
|
||||
}),
|
||||
new Element('a', {
|
||||
'text': 'Run install wizard',
|
||||
'href': App.createUrl('wizard')
|
||||
})].each(function(a){
|
||||
var setting_links = [
|
||||
new Element('a', {
|
||||
'text': 'About CouchPotato',
|
||||
'href': App.createUrl('settings/about')
|
||||
}),
|
||||
new Element('a', {
|
||||
'text': 'Check for Updates',
|
||||
'events': {
|
||||
'click': self.checkForUpdate.bind(self, null)
|
||||
}
|
||||
}),
|
||||
new Element('span.separator'),
|
||||
new Element('a', {
|
||||
'text': 'Settings',
|
||||
'href': App.createUrl('settings/general')
|
||||
}),
|
||||
new Element('a', {
|
||||
'text': 'Logs',
|
||||
'href': App.createUrl('log')
|
||||
}),
|
||||
new Element('span.separator'),
|
||||
new Element('a', {
|
||||
'text': 'Restart',
|
||||
'events': {
|
||||
'click': self.restartQA.bind(self)
|
||||
}
|
||||
}),
|
||||
new Element('a', {
|
||||
'text': 'Shutdown',
|
||||
'events': {
|
||||
'click': self.shutdownQA.bind(self)
|
||||
}
|
||||
})
|
||||
]
|
||||
|
||||
setting_links.each(function(a){
|
||||
self.block.more.addLink(a)
|
||||
})
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ Page.Home = new Class({
|
||||
if(timer) clearTimeout(timer);
|
||||
timer = (function(){
|
||||
images.setStyle('height', highest);
|
||||
}).delay(300);
|
||||
}).delay(50);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
@@ -11,20 +11,6 @@ Page.Settings = new Class({
|
||||
current: 'about',
|
||||
has_tab: false,
|
||||
|
||||
initialize: function(options){
|
||||
var self = this;
|
||||
self.parent(options);
|
||||
|
||||
// Add to more menu
|
||||
if(self.name == 'settings')
|
||||
App.getBlock('more').addLink(new Element('a', {
|
||||
'href': App.createUrl(self.name),
|
||||
'text': self.name.capitalize(),
|
||||
'title': self.title
|
||||
}), 'top')
|
||||
|
||||
},
|
||||
|
||||
open: function(action, params){
|
||||
var self = this;
|
||||
self.action = action == 'index' ? self.default_action : action;
|
||||
|
||||
Reference in New Issue
Block a user