File tree Expand file tree Collapse file tree
gcp/website/frontend3/src Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,6 +9,16 @@ import { MdFilledTextField } from '@material/web/textfield/filled-text-field.js'
99import { LitElement , html } from 'lit' ;
1010import { ExpandableSearch , SearchSuggestionsManager } from './search.js' ;
1111
12+ const COPY_ICON_RESET_MS = 1500 ;
13+
14+ document . addEventListener ( 'clipboard-copy' , ( { target} ) => {
15+ const icon = target . querySelector ( 'md-icon' ) ;
16+ if ( ! icon ) return ;
17+ clearTimeout ( target . _copyResetTimer ) ;
18+ icon . textContent = 'check' ;
19+ target . _copyResetTimer = setTimeout ( ( ) => { icon . textContent = 'content_copy' ; } , COPY_ICON_RESET_MS ) ;
20+ } ) ;
21+
1222// Submits a form in a way such that Turbo can intercept the event.
1323// Triggering submit on the form directly would still give a correct resulting
1424// page, but we want to let Turbo speed up renders as intended.
You can’t perform that action at this time.
0 commit comments