-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(preview): mouse events do not trigger
- Loading branch information
1 parent
5a93c84
commit 105b3aa
Showing
4 changed files
with
35 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,35 @@ | ||
import {Component, EventEmitter, Input, Output} from '@angular/core'; | ||
|
||
import {Item} from '../../item'; | ||
import {ItemBundle} from './item-bundle'; | ||
|
||
@Component({ | ||
selector: 'lb-items-from', | ||
template: ` | ||
<div *ngFor="let bundle of items"> | ||
<hr class="up"> | ||
<lb-item [item]="bundle.item" [attr.title]="bundle.item.name"></lb-item> | ||
<lb-item [item]="bundle.item" [attr.title]="bundle.item.name" | ||
(itemSelected)="selectItem($event)" | ||
(itemPicked)="pickItem($event)"></lb-item> | ||
<hr *ngIf="bundle.children" class="down"> | ||
<lb-items-from [items]="bundle.children" | ||
(itemSelected)="itemSelected.emit($event)" | ||
(itemPicked)="itemPicked.emit($event)"> | ||
(itemSelected)="selectItem($event)" | ||
(itemPicked)="pickItem($event)"> | ||
</lb-items-from> | ||
</div>` | ||
}) | ||
|
||
export class ItemsFromComponent { | ||
@Input() items: Array<ItemBundle>; | ||
@Output() itemSelected: EventEmitter<any> = new EventEmitter<any>(); | ||
@Output() itemPicked: EventEmitter<any> = new EventEmitter<any>(); | ||
@Output() itemSelected: EventEmitter<Item> = new EventEmitter<Item>(); | ||
@Output() itemPicked: EventEmitter<Item> = new EventEmitter<Item>(); | ||
|
||
selectItem(item: Item) { | ||
this.itemSelected.emit(item); | ||
} | ||
|
||
pickItem(item: Item) { | ||
this.itemPicked.emit(item); | ||
return false; // stop context menu from appearing | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters