fabien-d / alertify.js

JavaScript Alert/Notification System
http://fabien-d.github.com/alertify.js/
4.26k stars 725 forks source link

Alertify breaks when using turbolinks for rails #136

Closed mildfuzz closed 11 years ago

mildfuzz commented 11 years ago

As far as I can tell, Turbolinks messes with the global scope, which prevents the alerts being properly connected with the DOM.

My work around has been: //Keep global reference to alertify init() function $(document).on('ready',function(){ window alertifyInit = alertify.init; }); //re-initialise on page change/load $(document).on('page:change page:load',function(){ alertifyInit(); });

Hopefully, that hack will illuminate a solution to one of the devs (or at least help someone else out!!)

fabien-d commented 11 years ago

alertify.js 0.4 appears to be tied to -> https://github.com/fabien-d/alertify.js/pull/158

Seems like the issue is also happening in 0.3? I'm not familiar with turbolinks so hopefully someone can provide more insight.

fabien-d commented 11 years ago

Fixed with #161