Added a images loaded callback for nprogress loading bar
This commit is contained in:
parent
01ecccf9e5
commit
46dd25ffff
|
@ -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"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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()
|
||||
|
|
Reference in New Issue