Don't show button bar when there aren't any releases

This commit is contained in:
Ruud
2012-11-20 21:15:43 +01:00
parent 723f720280
commit 2ed72c9098
+26 -23
View File
@@ -479,29 +479,32 @@ var ReleaseAction = new Class({
self.release_container.getElement('#release_'+self.next_release.id).addClass('next_release'); self.release_container.getElement('#release_'+self.next_release.id).addClass('next_release');
} }
self.trynext_container.adopt( if(self.next_release || self.last_release){
new Element('span.or', {
'text': 'This movie is snatched, if anything went wrong, download' self.trynext_container.adopt(
}), new Element('span.or', {
self.last_release ? new Element('a.button.orange', { 'text': 'This movie is snatched, if anything went wrong, download'
'text': 'the same release again', }),
'events': { self.last_release ? new Element('a.button.orange', {
'click': self.trySameRelease.bind(self) 'text': 'the same release again',
} 'events': {
}) : null, 'click': self.trySameRelease.bind(self)
self.next_release && self.last_release ? new Element('span.or', { }
'text': ',' }) : null,
}) : null, self.next_release && self.last_release ? new Element('span.or', {
self.next_release ? [new Element('a.button.green', { 'text': ','
'text': self.last_release ? 'another release' : 'the best release', }) : null,
'events': { self.next_release ? [new Element('a.button.green', {
'click': self.tryNextRelease.bind(self) 'text': self.last_release ? 'another release' : 'the best release',
} 'events': {
}), 'click': self.tryNextRelease.bind(self)
new Element('span.or', { }
'text': 'or pick one below' }),
})] : null new Element('span.or', {
) 'text': 'or pick one below'
})] : null
)
}
} }