Optimize initial requests
This commit is contained in:
@@ -5,7 +5,7 @@ var UpdaterBase = new Class({
|
|||||||
initialize: function(){
|
initialize: function(){
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
App.addEvent('load', self.info.bind(self, 1000))
|
App.addEvent('load', self.info.bind(self, 2000))
|
||||||
App.addEvent('unload', function(){
|
App.addEvent('unload', function(){
|
||||||
if(self.timer)
|
if(self.timer)
|
||||||
clearTimeout(self.timer);
|
clearTimeout(self.timer);
|
||||||
|
|||||||
@@ -28,14 +28,10 @@ var NotificationBase = new Class({
|
|||||||
$(App.block.notification).inject(App.getBlock('search'), 'after');
|
$(App.block.notification).inject(App.getBlock('search'), 'after');
|
||||||
self.badge = new Element('div.badge').inject(App.block.notification, 'top').hide();
|
self.badge = new Element('div.badge').inject(App.block.notification, 'top').hide();
|
||||||
|
|
||||||
/* App.getBlock('notification').addLink(new Element('a.more', {
|
|
||||||
'href': App.createUrl('notifications'),
|
|
||||||
'text': 'Show older notifications'
|
|
||||||
})); */
|
|
||||||
});
|
});
|
||||||
|
|
||||||
window.addEvent('load', function(){
|
window.addEvent('load', function(){
|
||||||
self.startInterval.delay(Browser.safari ? 100 : 0, self)
|
self.startInterval.delay(2000, self)
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -255,18 +255,19 @@ var MovieList = new Class({
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Get available chars and highlight
|
// Get available chars and highlight
|
||||||
Api.request('movie.available_chars', {
|
if(self.navigation.isDisplayed() || self.navigation.isVisible())
|
||||||
'data': Object.merge({
|
Api.request('movie.available_chars', {
|
||||||
'status': self.options.status
|
'data': Object.merge({
|
||||||
}, self.filter),
|
'status': self.options.status
|
||||||
'onSuccess': function(json){
|
}, self.filter),
|
||||||
|
'onSuccess': function(json){
|
||||||
|
|
||||||
json.chars.split('').each(function(c){
|
json.chars.split('').each(function(c){
|
||||||
self.letters[c.capitalize()].addClass('available')
|
self.letters[c.capitalize()].addClass('available')
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Add menu or hide
|
// Add menu or hide
|
||||||
if (self.options.menu.length > 0)
|
if (self.options.menu.length > 0)
|
||||||
@@ -274,17 +275,7 @@ var MovieList = new Class({
|
|||||||
self.navigation_menu.addLink(menu_item);
|
self.navigation_menu.addLink(menu_item);
|
||||||
})
|
})
|
||||||
else
|
else
|
||||||
self.navigation_menu.hide()
|
self.navigation_menu.hide();
|
||||||
|
|
||||||
self.nav_scrollspy = new ScrollSpy({
|
|
||||||
min: 10,
|
|
||||||
onEnter: function(){
|
|
||||||
self.navigation.addClass('float')
|
|
||||||
},
|
|
||||||
onLeave: function(){
|
|
||||||
self.navigation.removeClass('float')
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ Page.Wanted = new Class({
|
|||||||
$(self.wanted).inject(self.el);
|
$(self.wanted).inject(self.el);
|
||||||
|
|
||||||
// Check if search is in progress
|
// Check if search is in progress
|
||||||
self.startProgressInterval();
|
self.startProgressInterval.delay(4000, self);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,15 @@
|
|||||||
<script type="text/javascript" src="https://www.youtube.com/player_api" defer="defer"></script>
|
<script type="text/javascript" src="https://www.youtube.com/player_api" defer="defer"></script>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
window.addEvent('load', function() {
|
||||||
|
|
||||||
|
setTimeout(function(){
|
||||||
|
window.scrollTo(0, 1);
|
||||||
|
window.scrollTo(0, 0);
|
||||||
|
}, 100);
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
window.addEvent('domready', function() {
|
window.addEvent('domready', function() {
|
||||||
new Uniform();
|
new Uniform();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user