diff --git a/app/views/conference/_gallery.html.haml b/app/views/conference/_gallery.html.haml index 4f04b20b..34959e63 100644 --- a/app/views/conference/_gallery.html.haml +++ b/app/views/conference/_gallery.html.haml @@ -15,18 +15,21 @@ :javascript - var count = 0; - $('#gallery-btn').click(function(){ - if(count == 0){ - $('#gallery').modal('show'); - $('#gallery .modal-body').append(''); - count +=1; - } - else{ - $('#gallery').modal('show'); - return false; - } + $(document).ready(function(){ + var count = 0; + $('#gallery-btn').click(function(){ + if(count == 0){ + $('#gallery').modal('show'); + $('#gallery .modal-body').append(''); + count +=1; + } + else{ + $('#gallery').modal('show'); + return false; + } + }); }); +