make sure to update sort field when fields moved

This commit is contained in:
Damien Elmes 2012-07-19 15:16:08 +09:00
parent 779bcbef39
commit 9d153313e5

View file

@ -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):