Skip to content
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

rcube_webmail.prototype vs. rcmail.addEventListener() #9544

Closed
pabzm opened this issue Jul 12, 2024 · 2 comments
Closed

rcube_webmail.prototype vs. rcmail.addEventListener() #9544

pabzm opened this issue Jul 12, 2024 · 2 comments

Comments

@pabzm
Copy link
Member

pabzm commented Jul 12, 2024

I'm seeing two code patterns to call js-functions from server code:

  1. Implement the JS-function on rcube_webmail.prototype and then call it on the rcmail instance,
  2. Add an event-listener to rcmail in JS, and from the server code make rcmail trigger it.

I'm wondering why both exist, since they serve identical purposes.

@alecpl Can we decide on one of them for future changes? Which one would you prefer? (I don't care much.)

@alecpl
Copy link
Member

alecpl commented Jul 15, 2024

Well, when you have a lot of code it's cleaner to "extend" the rcube_webmail object. I think we should keep both. Our javascript code "style" is quite outdated.

@pabzm
Copy link
Member Author

pabzm commented Jul 16, 2024

Ok. I'd then move towards using event-handlers in plugins and prototype-changes in core-code.

@pabzm pabzm closed this as completed Jul 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants