The example in the readme about events in the view doesn't seem to work, as the alert never shows:
var view = new Backbone.View({
initialize: function () {
this.bind("ok", okClicked);
},
okClicked: function (modal) {
alert("Ok was clicked");
modal.preventClose();
}
});
var modal = new Backbone.BootstrapModal({ content: view }).open();
This is the related code in backbone.bootstrap-modal.js:
The example in the readme about events in the view doesn't seem to work, as the alert never shows:
This is the related code in backbone.bootstrap-modal.js:
I'm rather new to Backbone so I don't fully get what's happening with the context when
this.options.content.trigger('ok', this)
is called.If someone could explain this to me and nudge me in the right direction to get the above example working, that would be great!
Thanks!