Merge pull request #5611 from MrPetovan/task/defer-ping-acl
Call asynchronous JS after complete page load
This commit is contained in:
commit
246b5644fb
|
@ -42,9 +42,6 @@ function ACL(backend_url, preset, automention, is_mobile){
|
||||||
/* add/remove mentions */
|
/* add/remove mentions */
|
||||||
this.element = $("#profile-jot-text");
|
this.element = $("#profile-jot-text");
|
||||||
this.htmlelm = this.element.get()[0];
|
this.htmlelm = this.element.get()[0];
|
||||||
|
|
||||||
/* startup! */
|
|
||||||
this.get(0,100);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ACL.prototype.remove_mention = function(id) {
|
ACL.prototype.remove_mention = function(id) {
|
||||||
|
@ -344,7 +341,7 @@ ACL.prototype.populate = function(data){
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Deselect previous selected contact.
|
* @brief Deselect previous selected contact.
|
||||||
*
|
*
|
||||||
* @param {int} id The contact ID.
|
* @param {int} id The contact ID.
|
||||||
* @returns {void}
|
* @returns {void}
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -302,7 +302,12 @@ $(function() {
|
||||||
$('#nav-notifications-menu').perfectScrollbar('update');
|
$('#nav-notifications-menu').perfectScrollbar('update');
|
||||||
});
|
});
|
||||||
|
|
||||||
NavUpdate();
|
// Asynchronous calls are deferred until the very end of the page load to ease on slower connections
|
||||||
|
window.addEventListener("load", function(){
|
||||||
|
NavUpdate();
|
||||||
|
acl.get(0, 100);
|
||||||
|
});
|
||||||
|
|
||||||
// Allow folks to stop the ajax page updates with the pause/break key
|
// Allow folks to stop the ajax page updates with the pause/break key
|
||||||
$(document).keydown(function(event) {
|
$(document).keydown(function(event) {
|
||||||
if (event.keyCode == '8') {
|
if (event.keyCode == '8') {
|
||||||
|
|
Loading…
Reference in a new issue