Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions gcp/website/frontend3/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ import { MdFilledTextField } from '@material/web/textfield/filled-text-field.js'
import { LitElement, html } from 'lit';
import { ExpandableSearch, SearchSuggestionsManager } from './search.js';

const COPY_ICON_RESET_MS = 1500;

document.addEventListener('clipboard-copy', ({target}) => {
const icon = target.querySelector('md-icon');
if (!icon) return;
clearTimeout(target._copyResetTimer);
icon.textContent = 'check';
target._copyResetTimer = setTimeout(() => { icon.textContent = 'content_copy'; }, COPY_ICON_RESET_MS);
});

// Submits a form in a way such that Turbo can intercept the event.
// Triggering submit on the form directly would still give a correct resulting
// page, but we want to let Turbo speed up renders as intended.
Expand Down