-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
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
Fix rename scenario for Internet Explorer #2321
Conversation
Heads up, a few of the tests broke
|
Using _.curry appeared to call the validate function before it needed to be called, which resulted in a JS error and prevented the modal from being displayed. Keeping the correct scope for the validate function is slightly reworked here so that _.curry does not need to be used, which lets things work as expected in IE. Also, update tests for new function signature. Refs #2315
47ea814
to
a45dba5
Compare
Thanks. Just pushed an amended commit to address the test failures. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, working as expected on IE11 and all other supported browsers.
@@ -457,14 +457,13 @@ var ScenarioDropDownMenuOptionsView = Marionette.ItemView.extend({ | |||
renameScenario: function() { | |||
var self = this, | |||
collection = self.model.collection, | |||
validate = _.bind(collection.validateNewScenarioName, collection), | |||
curriedValidationFunction = _.curry(validate)(this.model), | |||
validate = _.bind(collection.validateNewScenarioName, self.model), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't think we should change it, but could we have also moved this method onto the ScenarioModel
and avoided the binding?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, totally. I think that would work as well.
Thanks for the review. |
Overview
Using _.curry appeared to call the validate function before it needed to
be called, which resulted in a JS error and prevented the modal from
being displayed. Keeping the correct scope for the validate function is
slightly reworked here so that _.curry does not need to be used, which
lets things work as expected in IE.
Connects to #2315
Demo
Testing Instructions