| 37 | module.exports = (InventoryModal = (function () { |
| 38 | InventoryModal = class InventoryModal extends ModalView { |
| 39 | static initClass () { |
| 40 | this.prototype.id = 'inventory-modal' |
| 41 | this.prototype.className = 'modal fade play-modal' |
| 42 | this.prototype.template = template |
| 43 | this.prototype.slots = ['head', 'eyes', 'neck', 'torso', 'wrists', 'gloves', 'left-ring', 'right-ring', 'right-hand', 'left-hand', 'waist', 'feet', 'programming-book', 'pet', 'minion', 'flag'] //, 'misc-0', 'misc-1'] # TODO: bring in misc slot(s) again when we have space |
| 44 | this.prototype.ringSlots = ['left-ring', 'right-ring'] |
| 45 | this.prototype.closesOnClickOutside = false // because draggable somehow triggers hide when you don't drag onto a draggable |
| 46 | this.prototype.trapsFocus = false |
| 47 | |
| 48 | this.prototype.events = { |
| 49 | 'click .item-slot': 'onItemSlotClick', |
| 50 | 'click #unequipped .item': 'onUnequippedItemClick', |
| 51 | 'doubletap #unequipped .item': 'onUnequippedItemDoubleClick', |
| 52 | 'doubletap .item-slot .item': 'onEquippedItemDoubleClick', |
| 53 | 'click button.equip-item': 'onClickEquipItemButton', |
| 54 | 'shown.bs.modal': 'onShown', |
| 55 | 'click #choose-hero-button': 'onClickChooseHero', |
| 56 | 'click #play-level-button': 'onClickPlayLevel', |
| 57 | 'click .unlock-button': 'onUnlockButtonClicked', |
| 58 | 'click #equip-item-viewed': 'onClickEquipItemViewed', |
| 59 | 'click #unequip-item-viewed': 'onClickUnequipItemViewed', |
| 60 | 'click #subscriber-item-viewed': 'onClickSubscribeItemViewed', |
| 61 | 'click #close-modal': 'hide', |
| 62 | 'click .buy-gems-prompt-button': 'onBuyGemsPromptButtonClicked', |
| 63 | 'click .start-subscription-button': 'onSubscribeButtonClicked', |
| 64 | click: 'onClickedSomewhere', |
| 65 | 'update #unequipped .nano': 'onScrollUnequipped' |
| 66 | } |
| 67 | |
| 68 | this.prototype.shortcuts = { |
| 69 | esc: 'clearSelection', |
| 70 | enter: 'onClickPlayLevel' |
| 71 | } |
| 72 | } |
| 73 | |
| 74 | constructor (options) { |
| 75 | super(...arguments) |