[openstreetmap/openstreetmap-website] Replace richtext edit/preview buttons with tabs (PR #5042)

Anton Khorev notifications at github.com
Sat Aug 3 01:40:28 UTC 2024


Why are the *Edit* and *Preview* buttons inside the help card? The *Preview* button there makes it inconvenient to preview on small screens because you'll have to scroll to the end of the help pane to press the button and then scroll back to see the preview.

Before:
![image](https://github.com/user-attachments/assets/f3b46671-93b1-4b15-8153-753f53dbade5)

After:
![image](https://github.com/user-attachments/assets/5f34545a-e36e-4c88-8762-b3cb30dba400)

Uses https://getbootstrap.com/docs/5.3/components/navs-tabs/#javascript-behavior to switch between tab panes.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/5042

-- Commit Summary --

  * Change richtext edit/preview buttons type to non-submit
  * Convert richtext edit/preview buttons into tabs
  * Switch between richtext edit/preview using Bootstrap tab panes

-- File Changes --

    M app/assets/javascripts/richtext.js (38)
    M app/views/shared/_richtext_field.html.erb (18)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/5042.patch
https://github.com/openstreetmap/openstreetmap-website/pull/5042.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/5042 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20240802/2cb63f9a/attachment.htm>


More information about the rails-dev mailing list