We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
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:
'click .ok': function(event) { event.preventDefault(); this.trigger('ok'); if (this.options.content && this.options.content.trigger) { console.log("Content:", this.options.content); console.log("Modal :", this); this.options.content.trigger('ok', this); } if (this.options.okCloses) { this.close(); } }
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.
this.options.content.trigger('ok', this)
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!
The text was updated successfully, but these errors were encountered:
+1 for this
Sorry, something went wrong.
No branches or pull requests
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!
The text was updated successfully, but these errors were encountered: