fixed turbolinks/ready issue

This commit is contained in:
2016-09-28 21:23:01 -05:00
parent 4d89a5ecc3
commit 33f3be1c79
5 changed files with 15 additions and 10 deletions

View File

@ -15,7 +15,9 @@ function revealPassword($src){
$src.removeClass('fa-lock').addClass('fa-unlock');
}
$(function(){
// Use this instead of typical $().ready
// because turbolinks.
document.addEventListener("turbolinks:load", function() {
$("[data-id=passwd]").on("ajax:success", "a", function(e, data){
getPassword($(e.target).parent(), data.hash);
});