mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-04-13 03:20:59 +00:00
Addressing issue where ordering of new inlinepanel items created two items of the same order
This commit is contained in:
parent
f7b9390202
commit
09cdc99ff2
1 changed files with 4 additions and 1 deletions
|
|
@ -247,7 +247,10 @@ function InlinePanel(opts) {
|
|||
}
|
||||
self.initChildControls(fixPrefix(opts.emptyChildFormPrefix));
|
||||
if (opts.canOrder) {
|
||||
$(fixPrefix('#id_' + opts.emptyChildFormPrefix + '-ORDER')).val(formCount);
|
||||
/* NB form hidden inputs use 0-based index and only increment formCount *after* this function is run.
|
||||
Therefore formcount and order are currently equal and order must be incremented
|
||||
to ensure it's *greater* than previous item */
|
||||
$(fixPrefix('#id_' + opts.emptyChildFormPrefix + '-ORDER')).val(formCount + 1);
|
||||
}
|
||||
self.updateMoveButtonDisabledStates();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue