Only move legit items to the top of the stack

Fixes #11002 cc @natalieogle
This commit is contained in:
Ben Ogle
2016-02-29 11:32:28 -08:00
parent db507a36cb
commit 920d348014
2 changed files with 5 additions and 0 deletions

View File

@@ -307,6 +307,7 @@ class Pane extends Model
# Add item (or move item) to the end of the itemStack
addItemToStack: (newItem) ->
return unless newItem?
index = @itemStack.indexOf(newItem)
@itemStack.splice(index, 1) unless index is -1
@itemStack.push(newItem)