Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save Berny23/8a4aab8260041ed213e2ee2951f622ca to your computer and use it in GitHub Desktop.
Save Berny23/8a4aab8260041ed213e2ee2951f622ca to your computer and use it in GitHub Desktop.
// Kopieren des aktuellen Namens, wenn Master-Button geklickt wird.
// Muss nur einmal ausgeführt werden, sobald auf den Reiter "Sammeln" geklickt wurde.
var lastName = getCurrentSetName();
$('select#setauswahl').on('change', function() {
lastName = getCurrentSetName();
console.log(lastName);
//setTimeout(async() => await navigator.clipboard.writeText(finalName), 3000);
});
$('.sammelalbum-set > .btn-success').on('click', function() {
console.log(lastName);
navigator.clipboard.writeText(lastName);
lastName = getCurrentSetName();
console.log(lastName);
});
function getCurrentSetName () {
let name = $('.sammelalbum-set:visible > .btn').closest('.sammelalbum-set').attr('id').split('set-')[1];
return name[0].toUpperCase() + name.slice(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment