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

Fix: clipboard button not working #57

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HelllGuest
Copy link

@HelllGuest HelllGuest commented Dec 27, 2023

Hey team,

Resolved issue with non-functional clipboard button on homepage.

What I did:

  • Moved button logic to layouts\partials\footer.html

- Made some code changes to get it working smoothly
- Tested it to make sure it's all good
- Please take a look and let me know if you find any issues
- Added the following to the layouts\partials\footer.html

~~ ~~<!-- JavaScript code -->~~ ~~<script>~~ ~~document.getElementById('copy-button').addEventListener('click', () => {~~ ~~const curl = document.getElementById('curl');~~ ~~const range = document.createRange();~~ ~~range.selectNodeContents(curl);~~ ~~window.getSelection().removeAllRanges();~~ ~~window.getSelection().addRange(range);~~ ~~document.execCommand('copy');~~ ~~});~~ ~~</script>~~ ~~

Thanks!

@mcnaveen
Copy link

Resolves #56

Copy link

@subins2000 subins2000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HelllGuest I would also recommend to remove the copy button logic from this file since now the footer has the JS code https://github.com/AsahiLinux/AsahiLinux.github.io/blob/f2f936dbfe37476a4ae39f4afc51ae3a57c488c7/content/fedora.md

layouts/partials/footer.html Outdated Show resolved Hide resolved
layouts/partials/footer.html Outdated Show resolved Hide resolved
Resolved issue with non-functional clipboard button on homepage.

Signed-off-by: Anoop Kumar <[email protected]>
@HelllGuest
Copy link
Author

@HelllGuest I would also recommend to remove the copy button logic from this file since now the footer has the JS code https://github.com/AsahiLinux/AsahiLinux.github.io/blob/f2f936dbfe37476a4ae39f4afc51ae3a57c488c7/content/fedora.md

@subins2000 Done.

@marcan marcan force-pushed the main branch 3 times, most recently from 6fdf253 to 23a8902 Compare January 14, 2024 08:03
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.

3 participants