@pablobm commented on this pull request.


> -  addNoteButton.on("click", function (e) {
-    e.preventDefault();
-    e.stopPropagation();
-
-    if ($(this).hasClass("disabled")) return;
-
-    OSM.router.route("/note/new");
-  });

In the interest of separation of concerns, would it be possible to move these 
back into their modules, but as functions that can are called from 
`initializeMapButtons`?

So for example, this code here could live as `OSM.NewNote.initialize()`, called 
from `OSM.initializeMapButtons`.

It's not trivial because then there's the question of what to do with the 
routes, which are functions... I played a bit with the idea at 
https://github.com/hlfan/openstreetmap-website/compare/lazy-load-controllers...pablobm:lazy-load-controllers.
 What do you think?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6295#discussion_r2499621731
You are receiving this because you are subscribed to this thread.

Message ID: 
<openstreetmap/openstreetmap-website/pull/6295/review/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to