File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed
rubberduckvba.client/src/app/routes/indenter Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -419,8 +419,9 @@ <h4 class="card-title">Looking for a programmatic approach?</h4>
419
419
</ div >
420
420
421
421
< div class ="card-footer ">
422
- < button id ="copy-template " class ="btn btn-secondary mx-1 " type ="button ">
422
+ < button id ="copy-template " class ="btn mx-1 " [ngClass] =" wasCopied ? ' btn-success' : 'btn-secondary' " type ="button ">
423
423
< span > < i class ="fa fa-clipboard "> </ i > Copy</ span >
424
+ < span > < fa-icon [icon] ="wasTemplateCopied ? 'check' : 'clipboard' "> </ fa-icon > {{wasTemplateCopied ? 'Copied!' : 'Copy'}}</ span >
424
425
</ button >
425
426
</ div >
426
427
</ div >
@@ -444,7 +445,7 @@ <h4>Try it right here!</h4>
444
445
< span id ="indent-button-text "> Indent</ span >
445
446
</ button >
446
447
< button id ="copy-code " class ="btn mx-1 " [ngClass] ="wasCopied ? 'btn-success' : 'btn-secondary' " type ="button " [disabled] ="model.code.length == 0 " (click) ="copy() ">
447
- < span > < fa-icon [icon] ="'clipboard' "> </ fa-icon > {{wasCopied ? 'Copied!' : 'Copy'}}</ span >
448
+ < span > < fa-icon [icon] ="wasCopied ? 'check' : 'clipboard' "> </ fa-icon > {{wasCopied ? 'Copied!' : 'Copy'}}</ span >
448
449
</ button >
449
450
</ div >
450
451
</ div >
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ import { ApiClientService } from "../../services/api-client.service";
11
11
export class IndenterComponent implements OnInit {
12
12
private _model ! : IndenterViewModel ;
13
13
public wasCopied : boolean = false ;
14
+ public wasTemplateCopied : boolean = false ;
14
15
15
16
16
17
constructor ( fa : FaIconLibrary , private service : ApiClientService ) {
@@ -49,16 +50,23 @@ export class IndenterComponent implements OnInit {
49
50
this . model . indentedCode = vm . indentedCode ;
50
51
this . model . code = vm . indentedCode ;
51
52
this . isIndenterBusy = false ;
53
+ this . wasCopied = false ;
54
+ this . wasTemplateCopied = false ;
52
55
} ) ;
53
56
}
54
57
55
58
public clear ( ) : void {
56
59
this . model . code = '' ;
60
+ this . wasCopied = false ;
61
+ this . wasTemplateCopied = false ;
57
62
}
58
63
59
64
public copy ( ) : void {
60
65
navigator . clipboard . writeText ( this . model . code ) . then ( e => this . wasCopied = true ) ;
61
66
}
67
+ public copyTemplate ( ) : void {
68
+ navigator . clipboard . writeText ( this . asJson ) . then ( e => this . wasTemplateCopied = true ) ;
69
+ }
62
70
63
71
public onModelChanged ( code : string ) : void {
64
72
this . model . code = code ;
You can’t perform that action at this time.
0 commit comments