fmartingr
/
shelfzilla
Archived
1
0
Fork 0

Added a images loaded callback for nprogress loading bar

This commit is contained in:
Felipe Martin 2014-04-04 22:56:53 +02:00
parent 01ecccf9e5
commit 46dd25ffff
3 changed files with 9 additions and 3 deletions

View File

@ -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"
}
}

View File

@ -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"

View File

@ -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()