File tree Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Expand file tree Collapse file tree 1 file changed +16
-15
lines changed Original file line number Diff line number Diff line change 1- <script >
2- import { browser } from ' $app/environment' ;
3- import { page } from ' $app/stores' ;
4- import { readable , get } from ' svelte/store' ;
5-
6- // ///////////////////////
7-
1+ <script context =" module" >
82 /* ! clipboard-copy. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
93
104 function makeError () {
7468 }
7569 }
7670 }
71+ < / script>
7772
78- // ///////////////////////
73+ < script>
74+ import { browser } from ' $app/environment' ;
75+ import { page } from ' $app/stores' ;
76+ import { readable , get } from ' svelte/store' ;
7977
8078 /**
8179 * @typedef {unknown | Promise<unknown>} EncodeableData
221219 collapsed = data .collapsed [route];
222220 }
223221
224- let copied = false ;
222+ /**
223+ * @type {ReturnType<typeof setTimeout> | undefined}
224+ */
225+ let copied;
225226
226227 /**
227228 * @param {Event} e
232233 if (! parent) return ;
233234
234235 const codeEl = /** @type {HTMLPreElement} */ (parent .querySelector (' .super-debug--code' ));
235- if (codeEl) {
236- await clipboardCopy ( codeEl . innerText );
237- copied = true ;
238- setTimeout (() => (copied = false ), 800 );
239- }
236+ if (! codeEl) return ;
237+
238+ clearTimeout ( copied) ;
239+ await clipboardCopy ( codeEl . innerText );
240+ copied = setTimeout (() => (copied = undefined ), 900 );
240241 }
241242
242243 /**
617618 .super - debug-- copy {
618619 margin: 0 ;
619620 padding: 0 ;
620- padding- top: 3px ;
621+ padding- top: 2px ;
621622 background- color: transparent;
622623 border: 0 ;
623624 color: #666 ;
You can’t perform that action at this time.
0 commit comments