mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
make sure to update sort field when fields moved
This commit is contained in:
parent
779bcbef39
commit
9d153313e5
1 changed files with 5 additions and 1 deletions
|
@ -259,9 +259,13 @@ select id from cards where nid in (select id from notes where mid = ?)""",
|
|||
oldidx = m['flds'].index(field)
|
||||
if oldidx == idx:
|
||||
return
|
||||
# remember old sort field
|
||||
sortf = m['flds'][m['sortf']]
|
||||
# move
|
||||
m['flds'].remove(field)
|
||||
m['flds'].insert(idx, field)
|
||||
m['sortf'] = idx
|
||||
# restore sort field
|
||||
m['sortf'] = m['flds'].index(sortf)
|
||||
self._updateFieldOrds(m)
|
||||
self.save(m)
|
||||
def move(fields, oldidx=oldidx):
|
||||
|
|
Loading…
Reference in a new issue