Skip to content

Commit

Permalink
Merge pull request #363 from bashu/patch-1
Browse files Browse the repository at this point in the history
fix related lookup for django 1.8
  • Loading branch information
darklow committed Apr 29, 2015
2 parents 48f4d29 + 5dbfd69 commit 7950e0b
Showing 1 changed file with 19 additions and 7 deletions.
26 changes: 19 additions & 7 deletions suit/templates/admin/change_form.html
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,25 @@ <h4 class="italic-title">{% trans 'tools'|capfirst %}</h4>
{# render suit_form_includes at last position #}
{% include 'suit/includes/change_form_includes.html' with position='bottom' %}

{% if adminform and add %}
<script type="text/javascript">
(function ($) {
$('form#{{ opts.module_name }}_form :input[type!=button][type!=submit]:visible:enabled:first').focus();
})(django.jQuery);
</script>
{% endif %}
{% block admin_change_form_document_ready %}
<script type="text/javascript">
(function($) {
$(document).ready(function() {
$('.add-another').click(function(e) {
e.preventDefault();
showAddAnotherPopup(this);
});
$('.related-lookup').click(function(e) {
e.preventDefault();
showRelatedObjectLookupPopup(this);
});
{% if adminform and add %}
$('form#{{ opts.model_name }}_form :input[type!=button][type!=submit]:visible:enabled:first').focus()
{% endif %}
});
})(django.jQuery);
</script>
{% endblock %}

{# JavaScript for prepopulated fields #}
{% prepopulated_fields_js %}
Expand Down

0 comments on commit 7950e0b

Please sign in to comment.