Problem/Motivation
It is currently not possible to change the width and height of the media library modal. The values are hard-coded (in MediaLibraryUiBuilder::getDialogOptions()) and not changeable.
In #3127867-7: MediaLibraryWidget should use the media_library.ui_builder service when fetching modal dialog options, @seanB said:
I've had more questions about changing the width and height of the modal. We have discussed things like an alter hook before but since the class is also used in a lot of javascript we should not make it easy for people to change this.
As a first step I can see making this method non-static and fetch the options via the service is a good step to help with this. Calling the static method on the class is definitely not developer friendly. I guess if we make the width and height configurable this would even help other people from not needing to override the service as well, but that can be a followup.
This is that follow-up.
Steps to reproduce
N/A
Proposed resolution
Make the dimensions configurable in some way -- ideally as settings of the Media Library field widget.
Remaining tasks
Write a patch with tests
Review and commit
User interface changes
TBD; possibly a couple of new configuration options for the Media Library field widget.
API changes
None.
Data model changes
The Media Library field widget may get a couple of new settings.
Release notes snippet
TBD
| Comment | File | Size | Author |
|---|---|---|---|
| #18 | 3167992-18-d10.3.x.patch | 1.76 KB | aasarava |
| #10 | interdiff_9-10.txt | 642 bytes | ranjith_kumar_k_u |
| #10 | 3167992-10.patch | 4.37 KB | ranjith_kumar_k_u |
| #9 | 3167992-9.patch | 4.09 KB | seanb |
Issue fork drupal-3167992
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
phenaproximaComment #4
mkimmet commentedThis would be really helpful functionality, as a bigger window size would make interacting with the media library easier.
Comment #6
mrpauldriver commentedI'd be keen to see this happen.
There is a lot of space around the modal which could be put to good use improving the UX of the media library.
Comment #7
phenaproximaThere is already an issue for this to be done in Media Library Extras: #3228196: Make it possible to configure the width and height of the media library
That issue is basically ready from a code perspective, but it needs someone to review and ideally manually test it before it can be committed.
Comment #9
seanbAttached patch makes the
MediaLibraryUiBuilder::dialogOptions()method non-static which would allow the settings to be overridden by decorating the UI builder service.Comment #10
ranjith_kumar_k_u commentedComment #11
ranjith_kumar_k_u commentedComment #18
aasarava commentedRerolled patch to work with Drupal 10.3.x.