mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-04-01 15:50:11 -04:00
Fixed bug with dragging an item to unequip it not updating rest of state.
This commit is contained in:
parent
c1e14dc973
commit
178082d4e8
1 changed files with 6 additions and 1 deletions
|
@ -222,8 +222,13 @@ module.exports = class InventoryModal extends ModalView
|
|||
|
||||
makeEquippedSlotDraggable: (slot) ->
|
||||
unequip = =>
|
||||
@unequipItemFromSlot slot
|
||||
itemEl = @unequipItemFromSlot slot
|
||||
selectedSlotItemID = itemEl.data('item-id')
|
||||
item = @items.get(selectedSlotItemID)
|
||||
@requireLevelEquipment()
|
||||
@showItemDetails(item, 'equip')
|
||||
@onSelectionChanged()
|
||||
@onEquipmentChanged()
|
||||
shouldStayEquippedWhenDropped = (isValidDrop) ->
|
||||
pos = $(@).position()
|
||||
revert = Math.abs(pos.left) < $(@).outerWidth() and Math.abs(pos.top) < $(@).outerHeight()
|
||||
|
|
Loading…
Add table
Reference in a new issue