Updated jQuery to 1.9.1 and jQueryUI to 1.10.2.
Added create function handler to unbind events from sortable that were being applied to checkboxes within a sortable item. This was preventing the delete checkbox for inline models from being checked. Updated JavaScript inlcudes to not include unnecessary files.master
parent
a49bb81e1b
commit
7f3bbbed4c
|
|
@ -14,7 +14,11 @@ jQuery(function($){
|
|||
$.ajax({
|
||||
url: ui.item.find('a.admin_sorting_url').attr('href'),
|
||||
type: 'POST',
|
||||
data: { indexes: indexes.join(',') }
|
||||
data: { indexes: indexes.join(',') },
|
||||
success: function()
|
||||
{
|
||||
ui.item.effect('highlight', {}, 1000);
|
||||
}
|
||||
});
|
||||
}
|
||||
}).click(function(e){
|
||||
|
|
|
|||
|
|
@ -3,9 +3,13 @@ jQuery(function($){
|
|||
{
|
||||
var sortable_inline_rows = $('.inline-group .inline-related');
|
||||
sortable_inline_rows.addClass('sortable');
|
||||
|
||||
$('.inline-group').sortable({
|
||||
axis : 'y',
|
||||
containment : 'parent',
|
||||
create: function(event, ui) {
|
||||
$('.inline-related :checkbox').unbind();
|
||||
},
|
||||
tolerance : 'pointer',
|
||||
items : '.inline-related',
|
||||
stop : function(event, ui)
|
||||
|
|
|
|||
|
|
@ -6,6 +6,10 @@ jQuery(function($){
|
|||
$('.tabular.inline-related').sortable({
|
||||
axis : 'y',
|
||||
containment : 'parent',
|
||||
create: function(event, ui)
|
||||
{
|
||||
$('td.delete :checkbox').unbind();
|
||||
},
|
||||
tolerance : 'pointer',
|
||||
items : 'tr:not(.add-row)',
|
||||
stop : function(event, ui)
|
||||
|
|
|
|||
|
|
@ -7,11 +7,14 @@
|
|||
{% url 'admin:jsi18n' as jsi18nurl %}
|
||||
|
||||
{% if has_sortable_tabular_inlines or has_sortable_stacked_inlines %}
|
||||
{% include sortable_javascript_includes_template %}
|
||||
{% include sortable_javascript_includes_template with inlines=True %}
|
||||
{% endif %}
|
||||
{% if has_sortable_tabular_inlines %}
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}adminsortable/js/admin.sortable.tabular.inlines.js"></script>
|
||||
{% endif %}
|
||||
{% if has_sortable_stacked_inlines %}
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}adminsortable/js/admin.sortable.stacked.inlines.js"></script>
|
||||
{% endif %}
|
||||
{% if has_sortable_stacked_inlines %}
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}adminsortable/js/jquery.effects.core.js"></script>
|
||||
{% endif %}
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@
|
|||
{% block extrahead %}
|
||||
{{ block.super }}
|
||||
{% include sortable_javascript_includes_template %}
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}adminsortable/js/admin.sortable.js"></script>
|
||||
{% endblock %}
|
||||
|
||||
{% block breadcrumbs %}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,2 @@
|
|||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}adminsortable/js/admin.sortable.stacked.inlines.js"></script>
|
||||
<script type="text/javascript" src="{{ STATIC_URL }}adminsortable/js/admin.sortable.js"></script>
|
||||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.2/jquery-ui.min.js"></script>
|
||||
|
|
|
|||
Binary file not shown.
Loading…
Reference in New Issue