mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2024-11-24 08:08:15 -05:00
Worked around bug with item portraits disappearing after item purchase. Fixed #1980.
This commit is contained in:
parent
212c6e21a2
commit
1e410e0b14
2 changed files with 4 additions and 4 deletions
|
@ -1,7 +1,7 @@
|
|||
{me} = require 'core/auth'
|
||||
SuperModel = require 'models/SuperModel'
|
||||
|
||||
debugAnalytics = true
|
||||
debugAnalytics = false
|
||||
|
||||
module.exports = class Tracker
|
||||
constructor: ->
|
||||
|
|
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue