mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
Trim content when copying to clipboard
This commit is contained in:
parent
c7d625f23e
commit
6aab704144
@ -1,3 +1,14 @@
|
|||||||
|
function attachClipboard(selector) {
|
||||||
|
|
||||||
|
new ClipboardJS(selector, {
|
||||||
|
text: function(trigger) {
|
||||||
|
var content = trigger.parentElement.parentElement.textContent;
|
||||||
|
|
||||||
|
return content.trim();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
function inventreeDocReady() {
|
function inventreeDocReady() {
|
||||||
/* Run this function when the HTML document is loaded.
|
/* Run this function when the HTML document is loaded.
|
||||||
* This will be called for every page that extends "base.html"
|
* This will be called for every page that extends "base.html"
|
||||||
@ -50,11 +61,8 @@ function inventreeDocReady() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Initialize clipboard-buttons
|
// Initialize clipboard-buttons
|
||||||
new ClipboardJS('.clip-btn', {
|
attachClipboard('.clip-btn');
|
||||||
text: function(trigger) {
|
|
||||||
return trigger.parentElement.parentElement.textContent;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function isFileTransfer(transfer) {
|
function isFileTransfer(transfer) {
|
||||||
|
Loading…
Reference in New Issue
Block a user