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

refactor Twinkle.addPortlet() #1882

Open
4 tasks
NovemLinguae opened this issue Nov 3, 2023 · 0 comments
Open
4 tasks

refactor Twinkle.addPortlet() #1882

NovemLinguae opened this issue Nov 3, 2023 · 0 comments
Labels
Module: twinkle The twinkle.js global gadget file

Comments

@NovemLinguae
Copy link
Member

Now that #1881 is merged and once #1836 is merged, there's still some opportunities for refactoring the Twinkle.addPortlet() code.

  • This whole idea of having 5 variables passed into Twinkle.addPortlet() is flawed. The whole thing should be rewritten to pass in 1 variable (the skin name).
  • We can probably remove portletType/type, and add a comment that portletNext = 'p-cactions' will create a dropdown in vector and vector-2022.
  • Maybe rename portletArea/navigation to needsPortlet or something.
  • document.getElementById(navigation) || document.querySelector(navigation) can be simplified to document.querySelector(navigation), and portletAreas not in CSS notation such as right-navigation can be changed to #right-navigation

Probably other tweaks as I immerse myself.

@NovemLinguae NovemLinguae added the Module: twinkle The twinkle.js global gadget file label Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Module: twinkle The twinkle.js global gadget file
Projects
None yet
Development

No branches or pull requests

1 participant