Skip to content

Instantly share code, notes, and snippets.

@webinfinita
Created March 17, 2015 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save webinfinita/71a532f047ea834ce94e to your computer and use it in GitHub Desktop.
Save webinfinita/71a532f047ea834ce94e to your computer and use it in GitHub Desktop.
Common helper functions
$(document).ready(function(){
$('*[data-confirm]').on('click', function(e) {
var conf = confirm($(this).data('confirm'));
if(! conf) e.preventDefault();
});
$('body').on('hidden.bs.modal', '.modal', function () {
$(this).removeData('bs.modal');
});
$('form').submit(function(){
var btn =$(this).find('input[type=submit],button[type=submit]');
btn.attr('disabled', true);
btn.html("<i class='fa fa-cog fa-spin'></i> Procesando...");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment