Disable save button when creating new object

This commit is contained in:
Lance Edgar 2016-11-14 17:51:23 -06:00
parent ad2724fd2f
commit 73fcf84d59

View file

@ -3,6 +3,23 @@
<%def name="title()">New ${model_title}</%def> <%def name="title()">New ${model_title}</%def>
<%def name="head_tags()">
${parent.head_tags()}
<script type="text/javascript">
$(function() {
$('form').submit(function() {
var submit = $(this).find('input[type="submit"]');
if (submit.length) {
submit.button('disable').button('option', 'label', "Saving, please wait...");
}
});
});
</script>
</%def>
<%def name="context_menu_items()"> <%def name="context_menu_items()">
% if request.has_perm('{}.list'.format(permission_prefix)): % if request.has_perm('{}.list'.format(permission_prefix)):
<li>${h.link_to("Back to {}".format(model_title_plural), index_url)}</li> <li>${h.link_to("Back to {}".format(model_title_plural), index_url)}</li>