Skip to content

Instantly share code, notes, and snippets.

@justinvdm
Last active December 20, 2015 04:19
Show Gist options
  • Save justinvdm/6069817 to your computer and use it in GitHub Desktop.
Save justinvdm/6069817 to your computer and use it in GitHub Desktop.
var ChoiceOptionsView = TemplateView.extend({
jst: 'JST.campaign_dialogue_states_choice_options',
events: {
'click .close': 'remove',
// ...
},
initialize: function(options) {
this.choice = options.choice;
this.render();
},
render: function() {
ChoiceOptionsView.__super__.render.call(this);
// do popover stuff
}
});
var ChoiceStateEditView = DialogueStateEditView.extend({
// ...
events: {
// ...
'click .choice .options': 'onChoiceOptionsClick'
},
// ...
onChoiceOptionsClick: function(e) {
var $choice = $(e.target).parent(),
choice = this.state.endpoints.get($choice.attr('data-endpoint-id'));
new ChoiceOptionsView({choice: choice});
}
// ...
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment