-
Notifications
You must be signed in to change notification settings - Fork 49
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
Make the JavaScript more extendable #36
Comments
While I agree that the implementation should be consistent and using the chosen way throughout - What is your opinion on dirty vs extendible entwine? |
I care a great deal about extensibility, especially because I am in need of extensibility right now, and the order form is causing me a lot of pain. |
It's been a while since I have looked at this. Not clear on entwine namespaces but I think you can use more specific selectors in some cases. I'd like to continue using entwine, changing it out would probably mean altering some of the modifier modules e.g: If you need to replace the javascript completely you could try replacing the OrderForm completely with Object::use_custom_class() and you can effectively replace the Javascript at the same time if that helps. |
If going with the entwine stuff - please use a lot of comments. That stuff is so geeky and very few frontenders know how it works. |
@NobrainerWeb fair point, given that SilverStripe uses entwine I think it is ok to keep using it personally but agree we want to keep it simple where possible. |
@frankmullenger well, yes, I could overwrite that class or block the file. @NobrainerWeb I actually find entwine to be a lot more comprehensible and clear than regular jQuery spaghetti code. But agreed, comments are always good. |
Some parts of the Javascript are pretty much unextendable and unchangeable.
I am not sure if I am just to stupid to use entwine namespaces, but I have been trying for ages to overwrite the OrderForm submit handler.
the submit handler is bound using
this.on('submit', function(e){})
inonmatch
of$('.order-form')
We should refactor that to use the entwine onsubmit syntax.
The text was updated successfully, but these errors were encountered: