Mercurial > hg > batmud > chester
changeset 15:2aa632a8610f
AutoMove: Don't clear item selections if no changes were made.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 10 Jan 2011 09:11:49 +0200 |
parents | 11f9c6fc4e6e |
children | 2369d74f50a1 |
files | index.php |
diffstat | 1 files changed, 6 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/index.php Mon Jan 10 09:05:40 2011 +0200 +++ b/index.php Mon Jan 10 09:11:49 2011 +0200 @@ -786,11 +786,13 @@ var remaining = selected.length; var n = 0; + var changed = 0; while (remaining > 0 && n < list_containers.length) { curr = list_containers[n]; for (var q = curr.getSpace(); q > 0 && remaining > 0; q--) { remaining--; + changed++; if (!list_items.moveItemById(curr, selected[remaining])) { statusMsg("Internal error moving item #"+remaining+": '"+selected[remaining]+"'."); return; @@ -800,8 +802,10 @@ n++; } - list_items.flush(); - updatePage(); + if (changed > 0) { + list_items.flush(); + updatePage(); + } if (remaining > 0) { statusMsg("Not enough space! <b>"+ remaining +" of "+ selected.length +"</b> items left without slots!");