mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Explore: Create menu for short link button (#77336)
* WIP first pass * Change to toolbarbutton/buttonselect pattern * Move to two toolbarbuttons with dropdown * Justify text to the right of icons * Fix betterer * Fix styling and tests * Add to docs * Perist last clicked, add translations * move styling to core component * use label for tooltip, let parser combine panes in multiple params * Explore: Panes encoding suggestions (#78210) panes encoding suggestions * WIP-add menu groups * Get group actions working * add icons and non-local last selected state * Fix translations after merge * Add categories to translation, tweak the verbiage * Fix translation extraction * Fix tests * fix translation conflict * Log if time is absolute --------- Co-authored-by: Giordano Ricci <me@giordanoricci.com>
This commit is contained in:
@@ -342,10 +342,14 @@ export function getIntervals(range: TimeRange, lowLimit?: string, resolution?: n
|
||||
}
|
||||
|
||||
export const copyStringToClipboard = (string: string) => {
|
||||
const el = document.createElement('textarea');
|
||||
el.value = string;
|
||||
document.body.appendChild(el);
|
||||
el.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(el);
|
||||
if (navigator.clipboard && window.isSecureContext) {
|
||||
navigator.clipboard.writeText(string);
|
||||
} else {
|
||||
const el = document.createElement('textarea');
|
||||
el.value = string;
|
||||
document.body.appendChild(el);
|
||||
el.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(el);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user