Commit e51fdbf4 authored by Vincent Tam's avatar Vincent Tam

Update copyBtn.js

parent bf918b81
Pipeline #39730936 passed with stages
in 47 seconds
...@@ -4,7 +4,8 @@ $(document).ready(function() { ...@@ -4,7 +4,8 @@ $(document).ready(function() {
}); });
}); });
function copy(selector){ function copy(selector) {
var screenTop = $(document).scrollTop();
var $temp = $("<div>"); var $temp = $("<div>");
$("body").append($temp); $("body").append($temp);
$temp.attr("contenteditable", true) $temp.attr("contenteditable", true)
...@@ -13,4 +14,5 @@ function copy(selector){ ...@@ -13,4 +14,5 @@ function copy(selector){
.focus(); .focus();
document.execCommand("copy"); document.execCommand("copy");
$temp.remove(); $temp.remove();
$(document).css('top', screentop);
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment