Fix broken copy (#3314)

* update clipboard version

* attach clipboard to about model

* make definition simpler

* make version text copyable
This commit is contained in:
Matthias Mair 2022-07-09 04:49:53 +02:00 committed by GitHub
parent 4b0b76ecc5
commit e314e879da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 5 deletions

File diff suppressed because one or more lines are too long

View File

@ -40,8 +40,7 @@ function attachClipboard(selector, containerselector, textElement) {
}
// create Clipboard
// eslint-disable-next-line no-unused-vars
var cis = new ClipboardJS(selector, {
new ClipboardJS(selector, {
text: text,
container: containerselector
});
@ -110,6 +109,9 @@ function inventreeDocReady() {
$('#launch-about').click(function() {
launchModalForm(`/about/`, {
no_post: true,
after_render: function() {
attachClipboard('.clip-btn', 'modal-form');
}
});
});

View File

@ -81,7 +81,7 @@
<td>
<span style="display: none;" id="about-copy-text">{% include "version.html" %}</span>
<span class="float-right">
<button class="btn clip-btn-version" type="button" data-bs-toggle='tooltip' title='{% trans "copy to clipboard" %}'><em class="fas fa-copy"></em> {% trans "copy version information" %}</button>
<button class="btn clip-btn" type="button" data-bs-toggle='tooltip' title='{% trans "copy to clipboard" %}'><em class="fas fa-copy"></em> {% trans "copy version information" %}</button>
</span>
</td>
</tr>