Open alphamarket opened 7 years ago
I am no master JScriptor and just looking into the codings and googled some stuff and it seems that nprogress.js#L11 the NProgess
is setting to the window
not document
; I have no clue (nor google I guess :D) that how can I assign the document
as root in the code, so I have come up with a workaround, just assign the window.NProgess
to document.NProgress
and then create a ajax:start
and ajax:stop
to start/stop the document.NProgress
and you are good to go with iframes
.
jQuery(function() {
document.NProgress = window.NProgress;
$(document)
.ajaxStart(function(){ document.NProgress.start(); })
.ajaxStop(function(){ document.NProgress.done(); });
});
// do stuff with `document.NProgress` in iframe
I would have create a nprogress-ajax-iframe
module for this repo and create a pull request, but since this project is so inactive(i.e having 28 pending pull requests at the moment I am writing this :-1: ) I don't think it's worthy of my time, and just writting this stuffs for the sake of future wonders ;)
I have a parent window which uses the
NProgress
and it works great but:iframe
which has theNProgress
too, atajax:start
it starts spinning but atajax:stop
it doesn't stop! I can confirm that theajax:stop
fires in an iframe.iframe
but it restarts itself again after a second or so, and also I can confirm that there is no new ajax call initiated in that period.WHY is this & HOW can I fix this?