Copy site url with peers link to sidebar
This commit is contained in:
parent
405394707f
commit
a07a31a2bb
3 changed files with 37 additions and 1 deletions
|
@ -358,6 +358,19 @@ class Sidebar extends Class
|
|||
@wrapper.ws.cmd "serverShowdirectory", ["site", @wrapper.site_info.address]
|
||||
return false
|
||||
|
||||
# Copy site with peers
|
||||
@tag.find("#link-copypeers").off("click touchend").on "click touchend", (e) =>
|
||||
copy_text = e.currentTarget.href
|
||||
handler = (e) =>
|
||||
e.clipboardData.setData('text/plain', copy_text)
|
||||
e.preventDefault()
|
||||
@wrapper.notifications.add "copy", "done", "Site address with peers copied to your clipboard", 5000
|
||||
document.removeEventListener('copy', handler, true)
|
||||
|
||||
document.addEventListener('copy', handler, true)
|
||||
document.execCommand('copy')
|
||||
return false
|
||||
|
||||
# Sign and publish content.json
|
||||
$(document).on "click touchend", =>
|
||||
@tag?.find("#button-sign-publish-menu").removeClass("visible")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue