camper/web/templates/admin/media
jordi fita mas 5a16fa44a6 Change media picker from <div> to <dialog> and make it modal
Have to call Dialog.showModal when HTMx loaded the dialog in the DOM,
so had to add a onLoad event listened that checks whether the loaded
element is actually a DIALOG.

Had to restrict the margin: 0 for all elements (*) to exclude dialog,
because the browser sets it to auto, and i did not want to set it again
just because i was too overzealous with my “reset”.

The rest of the CSS is just to have a sticky header and footer, and see
the cancel button, that works as a “close”, all the time.

Finally, i realized that if i add the dialog at the end of the fieldset
and let HTMx inherit its hx-target and hx-swap, i no longer need to set
them in the dialog, as HTMx will always replace the fieldset, and i can
have the dialog side by side the current content of the fieldset, that
it was very confusing seeing it disappear when trying to select a new
media.

The cancel button could now just remove the dialog instead of making the
POST, but in local it makes no difference; we’lls see what happens on
production.
2023-09-22 02:11:03 +02:00
..
field.gohtml Manage all media uploads in a single place 2023-09-21 01:56:44 +02:00
form.gohtml Manage all media uploads in a single place 2023-09-21 01:56:44 +02:00
index.gohtml Manage all media uploads in a single place 2023-09-21 01:56:44 +02:00
picker.gohtml Change media picker from <div> to <dialog> and make it modal 2023-09-22 02:11:03 +02:00
upload.gohtml Add the upload form to the media picker 2023-09-22 01:40:22 +02:00