diff --git a/bower.json b/bower.json index 8366725..764f5be 100644 --- a/bower.json +++ b/bower.json @@ -19,6 +19,7 @@ "vegas": "~1.3.4", "jquery-pjax": "~1.8.1", "nprogress": "~0.1.3", - "toastr": "~2.0.1" + "toastr": "~2.0.1", + "imagesloaded": "~3.1.4" } } diff --git a/gruntfile.coffee b/gruntfile.coffee index 478f638..cc81907 100644 --- a/gruntfile.coffee +++ b/gruntfile.coffee @@ -54,6 +54,9 @@ module.exports = (grunt) -> "static_components/js/jquery-pjax.js", "static_components/js/nprogress.js", "static_components/js/toastr.js", + "static_components/js/eventemitter.js", + "static_components/js/eventie.js", + "static_components/js/imagesloaded.js", "shelfzilla/themes/bootflat/static/js/main.full.js", ] dest: "shelfzilla/themes/bootflat/static/js/site.js" diff --git a/shelfzilla/themes/bootflat/static/coffee/main.coffee b/shelfzilla/themes/bootflat/static/coffee/main.coffee index 52a585a..f5175dc 100644 --- a/shelfzilla/themes/bootflat/static/coffee/main.coffee +++ b/shelfzilla/themes/bootflat/static/coffee/main.coffee @@ -55,7 +55,9 @@ $('[data-toggle="tooltip"]').tooltip(); # Nprogress $(document).on 'pjax:start', -> NProgress.start() -$(document).on 'pjax:end', -> - NProgress.done() +$(document).on 'pjax:end', (event) -> + $(event.target).imagesLoaded -> + NProgress.done() + if window._updateMessages window.updateMessages()