From 1e410e0b1413f3d0f7bb46241df77f1e2bc5d03a Mon Sep 17 00:00:00 2001 From: Nick Winter Date: Sat, 31 Jan 2015 14:38:54 -0800 Subject: [PATCH] Worked around bug with item portraits disappearing after item purchase. Fixed #1980. --- app/core/Tracker.coffee | 2 +- app/views/play/menu/InventoryModal.coffee | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/core/Tracker.coffee b/app/core/Tracker.coffee index a9d07905a..5c987bc72 100644 --- a/app/core/Tracker.coffee +++ b/app/core/Tracker.coffee @@ -1,7 +1,7 @@ {me} = require 'core/auth' SuperModel = require 'models/SuperModel' -debugAnalytics = true +debugAnalytics = false module.exports = class Tracker constructor: -> diff --git a/app/views/play/menu/InventoryModal.coffee b/app/views/play/menu/InventoryModal.coffee index 4cdd7f6d6..218f872d4 100644 --- a/app/views/play/menu/InventoryModal.coffee +++ b/app/views/play/menu/InventoryModal.coffee @@ -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())