Skip to content

Instantly share code, notes, and snippets.

@scottmessinger
Last active December 13, 2015 18:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save scottmessinger/4953335 to your computer and use it in GitHub Desktop.
Save scottmessinger/4953335 to your computer and use it in GitHub Desktop.
<div class="selected-standards">
<ul>
{{#each selected in view.context.standards}}
<li class="box selected-triad">
<span {{ action toggleStandard selected view target="view.context"}}> {{selected.shortCode}} </span>
</li>
{{/each}}
</ul>
</div>
TS.AddStandardsModalView = Bootstrap.ModalPane.extend({
courseTriads: function(){
return _.filter(TS.allTriads, function(fullTriad){
return _.detect(this.get('context').course.triads, function(triadID){
return fullTriad.id === triadID
}, this)
}, this)
}.property('context.course.triads.@each'),
getTriad => .property() & .get('triad')
router.transitionTo(router.currentState.parentState.parentState.name) ->
router.transitionTo(router.get("currentState.parentState.parentState.name"))
// globals
addElement: function(params){
//only add if it is unique
found = _.detect(this.get('content'), function(data){
return params.triad.id === data.triad.id
})
// use set for ember objects
cancel: function(router, event){
this.exitState(router, event)
//needs to be done for moving between courses
_.each(TS.allTriads, function(item){
item.selected = false
})
},
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment