Rewrite JS hooks

- Use event listeners instead of homebrew hooks
- Remove view/js/addon-hooks.js and its references
- Update Addon docs
This commit is contained in:
Hypolite Petovan 2018-09-19 22:51:51 -04:00
parent 68c6895e1a
commit 7dd6fb3b3c
5 changed files with 8 additions and 59 deletions

View file

@ -478,14 +478,12 @@ function liveUpdate(src) {
$('.wall-item-body', data).imagesLoaded(function() {
updateConvItems(data);
document.dispatchEvent(new Event('postprocess_liveupdate'));
// Update the scroll position.
$(window).scrollTop($(window).scrollTop() + $("section").height() - orgHeight);
});
callAddonHooks("postprocess_liveupdate");
});
}
function imgbright(node) {
@ -735,6 +733,8 @@ function loadScrollContent() {
} else {
$("#scroll-end").fadeIn('normal');
}
document.dispatchEvent(new Event('postprocess_liveupdate'));
});
}