mirror of
https://github.com/Redocly/redoc.git
synced 2024-11-25 18:13:44 +03:00
parent
8193194e7a
commit
cd962faba4
|
@ -27,7 +27,10 @@ export class CopyButton implements OnInit {
|
|||
onClick() {
|
||||
let copied;
|
||||
if (this.copyText) {
|
||||
copied = Clipboard.copyCustom(JSON.stringify(this.copyText, null, 2));
|
||||
const text = (typeof this.copyText === 'string')
|
||||
? this.copyText
|
||||
: JSON.stringify(this.copyText, null, 2);
|
||||
copied = Clipboard.copyCustom(text);
|
||||
} else {
|
||||
copied = Clipboard.copyElement(this.copyElement);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user