mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
challenges: chevron in collapsing title
This commit is contained in:
parent
57f51048a1
commit
ae8a283d0e
2 changed files with 6 additions and 3 deletions
|
|
@ -7,7 +7,6 @@ module.exports.app = (appExports, model) ->
|
|||
user = model.at '_user'
|
||||
|
||||
appExports.challengeCreate = ->
|
||||
id = model.id()
|
||||
model.set '_challenge.new',
|
||||
name: ''
|
||||
habits: []
|
||||
|
|
@ -15,7 +14,7 @@ module.exports.app = (appExports, model) ->
|
|||
todos: []
|
||||
rewards: []
|
||||
assignTo: 'Party'
|
||||
id: id
|
||||
id: model.id()
|
||||
uuid: user.get('id')
|
||||
user: helpers.username(model.get('_user.auth'), model.get('_user.profile.name'))
|
||||
timestamp: +new Date
|
||||
|
|
@ -40,3 +39,7 @@ module.exports.app = (appExports, model) ->
|
|||
appExports.challengeUnsubscribe = (e) ->
|
||||
i = user.get('challenges')?.indexOf e.get('id')
|
||||
user.remove("challenges.#{i}") if i? and i != -1
|
||||
|
||||
appExports.challengeCollapse = (e, el) ->
|
||||
$(el).next().toggle()
|
||||
i = $(el).find('i').toggleClass 'icon-chevron-down'
|
||||
|
|
@ -40,7 +40,7 @@
|
|||
<a x-bind="click:challengeSubscribe" class='btn btn-large btn-success'><i class='icon-ok'></i> Subscribe</a>
|
||||
{/}
|
||||
</div>
|
||||
<h3 onClick="$(this).next().toggle();">{:challenge.name} (by {:challenge.user})</h3>
|
||||
<h3 x-bind="click:challengeCollapse"><i class='icon-chevron-down icon-chevron-right'></i> {:challenge.name} (by {:challenge.user})</h3>
|
||||
|
||||
|
||||
<div class="grid">
|
||||
|
|
|
|||
Loading…
Reference in a new issue