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

Update copy UI for citation modal #1376

Merged
merged 2 commits into from
Sep 5, 2024
Merged

Update copy UI for citation modal #1376

merged 2 commits into from
Sep 5, 2024

Conversation

thatbudakguy
Copy link
Member

@thatbudakguy thatbudakguy commented Sep 4, 2024

Closes #1335

This PR abstracts the controller that handled copying on the code snippets modal so that it can work for both the citation modal and code snippets modal, and then updates the UI for the citation modal to match.

Geoblacklight's own clipboardController doesn't include enough features to do this, but we can't redeclare a stimulus controller with that name, so the name was changed to clipboardCopyController. We could explore adding this functionality to Geoblacklight's version later.

Screenshot 2024-09-04 at 15 24 32

@dnoneill
Copy link
Contributor

dnoneill commented Sep 5, 2024

Is there a reason for copying we aren't using the copy stimulus control from geoblacklight?

@thatbudakguy
Copy link
Member Author

Yes – what I meant above by

Geoblacklight's own clipboardController doesn't include enough features to do this

Is that it doesn't support changing the target element to copy dynamically, which happens when you switch tabs on the code snippet modal.

It also expects an alert element to exist to update when you copy; we change the button text instead.

@hudajkhan hudajkhan merged commit 6d9f7c1 into main Sep 5, 2024
2 checks passed
@hudajkhan hudajkhan deleted the citation-modal-copy branch September 5, 2024 19:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Citation modal and copy to match Code snippets modal and copy
3 participants