mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-15 02:32:22 +00:00
user.on for itemstore popup, as per switz's suggestion
This commit is contained in:
parent
e1913d6929
commit
cf81339f7a
2 changed files with 13 additions and 12 deletions
|
|
@ -95,6 +95,19 @@ module.exports.setupGrowlNotifications = (model) ->
|
|||
allow_dismiss: true
|
||||
stackup_spacing: 10 # spacing between consecutive stacecked growls.
|
||||
|
||||
user.on 'set', 'items.itemsEnabled', (captures, args) ->
|
||||
return unless captures == true
|
||||
$('ul.items').popover
|
||||
title: content.items.unlockedMessage.title
|
||||
placement: 'left'
|
||||
trigger: 'manual'
|
||||
html: true
|
||||
content: "<div class='item-store-popover'>
|
||||
<img src='/img/BrowserQuest/chest.png' />
|
||||
#{content.items.unlockedMessage.content} <a href='#' onClick=\"$('ul.items').popover('hide');return false;\">[Close]</a>
|
||||
</div>"
|
||||
$('ul.items').popover 'show'
|
||||
|
||||
# Setup listeners which trigger notifications
|
||||
user.on 'set', 'stats.hp', (captures, args) ->
|
||||
num = captures - args
|
||||
|
|
|
|||
|
|
@ -98,18 +98,6 @@ updateStats = (newStats, update) ->
|
|||
userSet 'stats.hp', 50, update
|
||||
if !userObj.items.itemsEnabled and newStats.exp >=15
|
||||
userSet 'items.itemsEnabled', true, update
|
||||
if ($?) #can't run this on the server
|
||||
$('ul.items').popover
|
||||
title: content.items.unlockedMessage.title
|
||||
placement: 'left'
|
||||
trigger: 'manual'
|
||||
html: true
|
||||
content: "<div class='item-store-popover'>\
|
||||
<img src='/img/BrowserQuest/chest.png' />\
|
||||
#{content.items.unlockedMessage.content} <a href='#' onClick=\"$('ul.items').popover('hide');return false;\">[Close]</a>\
|
||||
</div>"
|
||||
$('ul.items').popover 'show'
|
||||
|
||||
userSet 'stats.exp', newStats.exp, update
|
||||
|
||||
if newStats.money?
|
||||
|
|
|
|||
Loading…
Reference in a new issue