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
|
@ -697,6 +697,21 @@ window.initScrollable = function () {
|
|||
return false;
|
||||
};
|
||||
})(this));
|
||||
this.tag.find("#link-copypeers").off("click touchend").on("click touchend", (function(_this) {
|
||||
return function(e) {
|
||||
var copy_text, handler;
|
||||
copy_text = e.currentTarget.href;
|
||||
handler = function(e) {
|
||||
e.clipboardData.setData('text/plain', copy_text);
|
||||
e.preventDefault();
|
||||
_this.wrapper.notifications.add("copy", "done", "Site address with peers copied to your clipboard", 5000);
|
||||
return document.removeEventListener('copy', handler, true);
|
||||
};
|
||||
document.addEventListener('copy', handler, true);
|
||||
document.execCommand('copy');
|
||||
return false;
|
||||
};
|
||||
})(this));
|
||||
$(document).on("click touchend", (function(_this) {
|
||||
return function() {
|
||||
var ref, ref1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue