Skip to content

Commit

Permalink
Add separate class for closable case
Browse files Browse the repository at this point in the history
  • Loading branch information
Çağatay Çivici authored and Çağatay Çivici committed Jul 30, 2018
1 parent e06c3dd commit 23770f1
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/app/components/inplace/inplace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export class InplaceContent {}
@Component({
selector: 'p-inplace',
template: `
<div [ngClass]="'ui-inplace ui-widget'" [ngStyle]="style" [class]="styleClass">
<div [ngClass]="{'ui-inplace ui-widget': true, 'ui-inplace-closable': closable}" [ngStyle]="style" [class]="styleClass">
<div class="ui-inplace-display" (click)="activate($event)"
[ngClass]="{'ui-state-disabled':disabled}" *ngIf="!active">
<ng-content select="[pInplaceDisplay]"></ng-content>
Expand All @@ -30,30 +30,30 @@ export class InplaceContent {}
`
})
export class Inplace {

@Input() active: boolean;

@Input() closable: boolean;

@Input() disabled: boolean;

@Input() style: any;

@Input() styleClass: string;

@Output() onActivate: EventEmitter<any> = new EventEmitter();

@Output() onDeactivate: EventEmitter<any> = new EventEmitter();

hover: boolean;

activate(event) {
if(!this.disabled) {
this.active = true;
this.onActivate.emit(event);
}
}

deactivate(event) {
if(!this.disabled) {
this.active = false;
Expand All @@ -68,4 +68,4 @@ export class Inplace {
exports: [Inplace,InplaceDisplay,InplaceContent,ButtonModule],
declarations: [Inplace,InplaceDisplay,InplaceContent]
})
export class InplaceModule { }
export class InplaceModule { }

0 comments on commit 23770f1

Please sign in to comment.