Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
anis-client
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
anis
anis-client
Commits
f9293075
Commit
f9293075
authored
5 years ago
by
Tifenn Guillas
Browse files
Options
Downloads
Patches
Plain Diff
Add copy to clipboard button => DONE
parent
13f2b0fd
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!68
Develop
,
!24
Add copy to clipboard button => DONE
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/app/search/components/url-display.component.html
+12
-2
12 additions, 2 deletions
src/app/search/components/url-display.component.html
src/app/search/components/url-display.component.ts
+14
-1
14 additions, 1 deletion
src/app/search/components/url-display.component.ts
with
26 additions
and
3 deletions
src/app/search/components/url-display.component.html
+
12
−
2
View file @
f9293075
...
...
@@ -13,9 +13,19 @@
<i
class=
"fas fa-circle-notch fa-spin fa-3x"
></i>
<span
class=
"sr-only"
>
Loading...
</span>
</div>
<p
*ngIf=
"!isLoading()"
>
<!--
<p *ngIf="!isLoading()">
<a target="_blank" [href]="getUrl()">{{ getUrl() }}</a>
</p>
</p> -->
<div
*ngIf=
"!isLoading()"
class=
"row"
>
<div
class=
"col"
>
<a
target=
"_blank"
[href]=
"getUrl()"
>
{{ getUrl() }}
</a>
</div>
<div
class=
"col-2 align-self-center text-center"
>
<button
class=
"btn btn-sm btn-outline-primary"
(click)=
"copyToClipboard()"
title=
"Copy url to clipboard"
>
<i
class=
"far fa-copy"
></i>
</button>
</div>
</div>
</div>
</accordion-group>
</accordion>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/app/search/components/url-display.component.ts
+
14
−
1
View file @
f9293075
import
{
Component
,
Input
,
ChangeDetectionStrategy
}
from
'
@angular/core
'
;
import
{
ToastrService
}
from
'
ngx-toastr
'
;
import
{
Criterion
}
from
'
../store/model
'
;
...
...
@@ -14,6 +15,8 @@ export class UrlDisplayComponent {
@
Input
()
criteriaList
:
Criterion
[];
@
Input
()
outputList
:
number
[];
constructor
(
private
toastr
:
ToastrService
)
{
}
isLoading
():
boolean
{
if
(
this
.
outputList
.
length
>
0
)
{
return
false
;
...
...
@@ -28,4 +31,14 @@ export class UrlDisplayComponent {
}
return
query
;
}
}
\ No newline at end of file
copyToClipboard
():
void
{
const
selBox
=
document
.
createElement
(
'
textarea
'
);
selBox
.
value
=
this
.
getUrl
();
document
.
body
.
appendChild
(
selBox
);
selBox
.
select
();
document
.
execCommand
(
'
copy
'
);
document
.
body
.
removeChild
(
selBox
);
this
.
toastr
.
success
(
'
Copied
'
);
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment