Worked around bug with item portraits disappearing after item purchase. Fixed #1980.

This commit is contained in:
Nick Winter 2015-01-31 14:38:54 -08:00
parent 212c6e21a2
commit 1e410e0b14
2 changed files with 4 additions and 4 deletions

View file

@ -1,7 +1,7 @@
{me} = require 'core/auth'
SuperModel = require 'models/SuperModel'
debugAnalytics = true
debugAnalytics = false
module.exports = class Tracker
constructor: ->

View file

@ -539,7 +539,7 @@ module.exports = class InventoryModal extends ModalView
@delegateEvents()
@setUpDraggableEventsForAvailableEquipment()
@itemDetailsView.setItem(item)
@onScrollUnequipped()
@onScrollUnequipped true
Backbone.Mediator.publish 'store:item-purchased', item: item, itemSlug: item.get('slug')
else
@ -575,7 +575,7 @@ module.exports = class InventoryModal extends ModalView
#- Dynamic portrait loading
onScrollUnequipped: ->
onScrollUnequipped: (forceLoadAll=false) ->
# dynamically load visible items when the user scrolls enough to see them
return if @destroyed
nanoContent = @$el.find('#unequipped .nano-content')
@ -583,7 +583,7 @@ module.exports = class InventoryModal extends ModalView
threshold = nanoContent.height() + 100
for itemEl in items
itemEl = $(itemEl)
if itemEl.position().top < threshold
if itemEl.position().top < threshold or forceLoadAll
itemEl.addClass('loaded')
item = @items.get(itemEl.data('item-id'))
itemEl.find('img').attr('src', item.getPortraitURL())