Add copy-url button

Took 11 minutes
This commit is contained in:
2020-10-04 22:36:06 +02:00
parent ba664edbdb
commit 9d5d7ab20d
3 changed files with 27 additions and 7 deletions

12
vendor/js/faq.js vendored
View File

@ -289,6 +289,18 @@ function welcomeMessage()
}
function copyShareUrl( btn )
{
let share_url = document.getElementById( "share_url" );
share_url.select();
share_url.setSelectionRange(0, 99999) ;
document.execCommand( "copy" );
$(btn).html( 'Copied!' );
setTimeout( function() { $(btn).html( 'Copy-URL' );}, 1500 );
}