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

Add clipboard.js and use it for "copy to clipboard" button on auth_link #2523

Merged
merged 1 commit into from
Feb 4, 2019

Conversation

hackartisan
Copy link
Member

fixes #2429

@hackartisan
Copy link
Member Author

screen shot 2019-02-04 at 5 16 27 pm

@hackartisan hackartisan changed the title Add cipboard.js and use it for "copy to clipboard" button on auth_link Add clipboard.js and use it for "copy to clipboard" button on auth_link Feb 4, 2019

document.addEventListener('DOMContentLoaded', () => {
let div = document.getElementById('clipboard-trigger-holder')
div.innerHTML = '<button class="btn btn-primary" id="clipboard-trigger">Copy link to clipboard</button>'
Copy link
Member

Choose a reason for hiding this comment

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

Are you setting the button text here so it doesn't display if there's a problem loading the javascript? Or is there some other reason not to include in the view HTML?

Copy link
Member Author

Choose a reason for hiding this comment

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

yeah, just sort of doing progressive enhancement I guess, since it only works if there's javascript.

Copy link
Member

Choose a reason for hiding this comment

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

👍

@escowles escowles merged commit 580e8be into master Feb 4, 2019
@escowles escowles deleted the 2429-clipboard-button branch February 4, 2019 22:45
@escowles escowles removed the Review label Feb 4, 2019
hackartisan added a commit that referenced this pull request Feb 5, 2019
hackartisan added a commit that referenced this pull request Feb 5, 2019
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.

Add a "clipboard" button to access links on playlists
2 participants