Skip to content

Commit

Permalink
JS: Sortable JS improvement that fixes empty inline creation when
Browse files Browse the repository at this point in the history
saving inlines with blank inputs.
  • Loading branch information
darklow committed Aug 15, 2013
1 parent 12e517f commit 435afaa
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion suit/static/suit/js/sortables.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,16 @@
$inline_sortable.append(create_link(icon.replace('-up', '-down'), 'down'));
});

// Filters out unchanged selects
// Filters out unchanged selects and sortable field itself
function filter_unchanged(i, input) {
if (input.type == 'select-one' || input.type == 'select-multiple') {
for (var j = 0; j < input.options.length; j++) {
if (input.options[j].selected == input.options[j].defaultSelected) {
return false;
}
}
}else if($(input).hasClass('suit-sortable')){
return false;
}
return true;
}
Expand Down

0 comments on commit 435afaa

Please sign in to comment.