🎨 Change the structure of a few pieces relating to serialization.

This commit is contained in:
natalieogle
2016-02-23 19:20:18 -08:00
parent 553b3f3300
commit bc28a91e02

View File

@@ -55,9 +55,7 @@ class Pane extends Model
if typeof @activeItem?.getURI is 'function'
activeItemURI = @activeItem.getURI()
itemsToBeSerialized = compact(@items.map((item) -> item if typeof item.serialize is 'function'))
itemStackIndices = []
for item in @itemStack
itemStackIndices.push(itemsToBeSerialized.indexOf(item)) if typeof item.serialize is 'function'
itemStackIndices = (itemsToBeSerialized.indexOf(item) for item in @itemStack when typeof item.serialize is 'function')
deserializer: 'Pane'
id: @id
@@ -305,6 +303,7 @@ class Pane extends Model
itemStackIndices = (i for i in [0..@items.length-1])
for itemIndex in itemStackIndices
@addItemToStack(@items[itemIndex])
return
# Add item (or move item) to the end of the itemStack
addItemToStack: (newItem) ->