challenges: chevron in collapsing title

This commit is contained in:
Tyler Renelle 2013-05-12 18:54:45 +01:00
parent 57f51048a1
commit ae8a283d0e
2 changed files with 6 additions and 3 deletions

View file

@ -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'

View file

@ -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">