mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4386] - fix style and remove value from tooltip (#4587)
This commit is contained in:
committed by
Eugenio Romano
parent
1eea972d6c
commit
61ee1f1d53
@@ -15,14 +15,14 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Directive, Input, HostListener, Component, ViewContainerRef, ComponentFactoryResolver, AfterContentInit } from '@angular/core';
|
||||
import { Directive, Input, HostListener, Component, ViewContainerRef, ComponentFactoryResolver, ViewEncapsulation } from '@angular/core';
|
||||
import { ClipboardService } from './clipboard.service';
|
||||
|
||||
@Directive({
|
||||
selector: '[adf-clipboard]',
|
||||
exportAs: 'adfClipboard'
|
||||
})
|
||||
export class ClipboardDirective implements AfterContentInit {
|
||||
export class ClipboardDirective {
|
||||
// tslint:disable-next-line:no-input-rename
|
||||
@Input('adf-clipboard')
|
||||
placeholder: string;
|
||||
@@ -33,8 +33,6 @@ export class ClipboardDirective implements AfterContentInit {
|
||||
// tslint:disable-next-line:no-input-rename
|
||||
@Input('clipboard-notification') message: string;
|
||||
|
||||
private value: string;
|
||||
|
||||
constructor(private clipboardService: ClipboardService,
|
||||
public viewContainerRef: ViewContainerRef,
|
||||
private resolver: ComponentFactoryResolver) {}
|
||||
@@ -50,7 +48,6 @@ export class ClipboardDirective implements AfterContentInit {
|
||||
showTooltip() {
|
||||
const componentFactory = this.resolver.resolveComponentFactory(ClipboardComponent);
|
||||
const componentRef = this.viewContainerRef.createComponent(componentFactory).instance;
|
||||
componentRef.copyText = this.value;
|
||||
componentRef.placeholder = this.placeholder;
|
||||
}
|
||||
|
||||
@@ -72,21 +69,15 @@ export class ClipboardDirective implements AfterContentInit {
|
||||
private copyContentToClipboard(content) {
|
||||
this.clipboardService.copyContentToClipboard(content, this.message);
|
||||
}
|
||||
|
||||
ngAfterContentInit() {
|
||||
setTimeout( () => {
|
||||
this.value = this.viewContainerRef.element.nativeElement.innerHTML;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'adf-datatable-highlight-tooltip',
|
||||
selector: 'adf-datatable-copy-content-tooltip',
|
||||
template: `
|
||||
<span class='adf-datatable-copy-tooltip'>{{ placeholder | translate }} <b> {{ copyText }} </b></span>
|
||||
`
|
||||
<span class='adf-datatable-copy-tooltip'>{{ placeholder | translate }} </span>
|
||||
`,
|
||||
encapsulation: ViewEncapsulation.None
|
||||
})
|
||||
export class ClipboardComponent {
|
||||
copyText: string;
|
||||
placeholder: string;
|
||||
}
|
||||
|
Reference in New Issue
Block a user