Last active
December 13, 2015 18:09
-
-
Save scottmessinger/4953335 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getTriad => .property() & .get('triad') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
router.transitionTo(router.currentState.parentState.parentState.name) -> | |
router.transitionTo(router.get("currentState.parentState.parentState.name")) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// globals | |
addElement: function(params){ | |
//only add if it is unique | |
found = _.detect(this.get('content'), function(data){ | |
return params.triad.id === data.triad.id | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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