Skip to content

Commit

Permalink
better click handler management for modals
Browse files Browse the repository at this point in the history
  • Loading branch information
jberger committed Jun 29, 2013
1 parent 262ad59 commit f00abdc
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Galileo/files/templates/user_menu.html.ep
Expand Up @@ -39,8 +39,10 @@
function show_modal(selector, callback) {
var modal = $(selector);
var button = modal.find('.btn-primary');
button.unbind( 'click' ); // remove previous click handlers
button.click( callback );

button.on( 'click', callback );
modal.on( 'hide', function() { button.off('click') });

modal.modal();
}

Expand Down

0 comments on commit f00abdc

Please sign in to comment.