Make inlines to work corectly with non sortable inlines
parent
daadd190cb
commit
cfcf6b1a46
|
|
@ -1,12 +1,16 @@
|
||||||
(function($){
|
(function($){
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
if ($(':hidden[name="admin_sorting_url"]').length > 0)
|
var sorting_urls = $(':hidden[name="admin_sorting_url"]');
|
||||||
|
if (sorting_urls.length > 0)
|
||||||
{
|
{
|
||||||
var sortable_inline_rows = $('.inline-group .inline-related');
|
var sortable_inline_groups = sorting_urls.closest('.inline-group')
|
||||||
|
var sortable_inline_rows = sortable_inline_groups.find('.inline-related');
|
||||||
|
|
||||||
|
sortable_inline_groups.addClass('sortable')
|
||||||
sortable_inline_rows.addClass('sortable');
|
sortable_inline_rows.addClass('sortable');
|
||||||
|
|
||||||
$('.inline-group').sortable({
|
sortable_inline_groups.sortable({
|
||||||
axis : 'y',
|
axis : 'y',
|
||||||
containment : 'parent',
|
containment : 'parent',
|
||||||
create: function(event, ui) {
|
create: function(event, ui) {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
(function($){
|
(function($){
|
||||||
|
|
||||||
$(function() {
|
$(function() {
|
||||||
if ($(':hidden[name="admin_sorting_url"]').length > 0)
|
var sorting_urls = $(':hidden[name="admin_sorting_url"]');
|
||||||
|
if (sorting_urls.length)
|
||||||
{
|
{
|
||||||
var tabular_inline_rows = $('.tabular table tbody tr');
|
var sortable_inline_group = sorting_urls.closest('.inline-group')
|
||||||
|
var tabular_inline_rows = sortable_inline_group.find('.tabular table tbody tr');
|
||||||
|
|
||||||
tabular_inline_rows.addClass('sortable');
|
tabular_inline_rows.addClass('sortable');
|
||||||
$('.tabular.inline-related').sortable({
|
|
||||||
|
sortable_inline_group.find('.tabular.inline-related').sortable({
|
||||||
axis : 'y',
|
axis : 'y',
|
||||||
containment : 'parent',
|
containment : 'parent',
|
||||||
create: function(event, ui) {
|
create: function(event, ui) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue