[DEV] add middle button

This commit is contained in:
Edouard DUPIN 2020-01-29 23:56:12 +01:00
parent 7b74dfa2be
commit 108675e6e6
10 changed files with 58 additions and 33 deletions

View File

@ -1,11 +1,11 @@
<div class="main-reduce">
<div class="fill-all">
<div *ngFor="let data of saisons" class="item" (click)="onSelectSaison(data)">
<div *ngFor="let data of saisons" class="item" (click)="onSelectSaison($event, data)" (auxclick)="onSelectSaison($event, data)">
<app-element-saison [id_saison]="data"></app-element-saison>
</div>
</div>
<div class="fill-all">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo(data)">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data)" (auxclick)="onSelectVideo($event, data)">
<app-element-video [id_video]="data"></app-element-video>
</div>
</div>

View File

@ -60,16 +60,22 @@ export class GroupComponent implements OnInit {
self.videos = []
});
}
onSelectSaison(_idSelected: number):void {
//this.router.navigate(['/type/' + this.type_id + '/group/' + this.id_group + '/saison/' + _idSelected ]);
this.router.navigate(['/saison/' + _idSelected ]);
this.arianeService.setSaison(_idSelected);
onSelectSaison(_event: any, _idSelected: number):void {
if(_event.which==2) {
window.open('/saison/' + _idSelected);
} else {
this.router.navigate(['/saison/' + _idSelected ]);
this.arianeService.setSaison(_idSelected);
}
}
onSelectVideo(_idSelected: number):void {
//this.router.navigate(['/type/' + this.type_id + '/group/' + this.id_group + '/video/' + _idSelected ]);
this.router.navigate(['/video/' + _idSelected ]);
this.arianeService.setVideo(_idSelected);
onSelectVideo(_event: any, _idSelected: number):void {
if(_event.which==2) {
window.open('/video/' + _idSelected);
} else {
this.router.navigate(['/video/' + _idSelected ]);
this.arianeService.setVideo(_idSelected);
}
}
}

View File

@ -1,6 +1,6 @@
<div class="main-reduce">
<div class="fill-all">
<div *ngFor="let data of data_list" class="item" (click)="onSelectType(data.id)">
<div *ngFor="let data of data_list" class="item" (click)="onSelectType($event, data.id)" (auxclick)="onSelectType($event, data.id)">
<app-element-type [id_type]="data.id"></app-element-type>
</div>
</div>

View File

@ -41,10 +41,14 @@ export class HomeComponent implements OnInit {
});
this.arianeService.reset();
}
onSelectType(_idSelected: number):void {
this.arianeService.setType(_idSelected);
//this.router.navigate(['type/', { id: _idSelected} ]);
this.router.navigate(['type/' + _idSelected ]);
onSelectType(_event: any, _idSelected: number):void {
if(_event.which==2) {
window.open('/type/' + _idSelected);
} else {
this.arianeService.setType(_idSelected);
//this.router.navigate(['type/', { id: _idSelected} ]);
this.router.navigate(['type/' + _idSelected ]);
}
}
}

View File

@ -1,6 +1,6 @@
<div class="main-reduce">
<div class="fill-all">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo(data)">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data)" (auxclick)="onSelectVideo($event, data)">
<app-element-video [id_video]="data"></app-element-video>
</div>
</div>

View File

@ -46,9 +46,13 @@ export class SaisonComponent implements OnInit {
});
}
onSelectVideo(_idSelected: number):void {
this.router.navigate(['video/' + _idSelected ]);
this.arianeService.setVideo(_idSelected);
onSelectVideo(_event: any, _idSelected: number):void {
if(_event.which==2) {
window.open('/video/' + _idSelected);
} else {
this.router.navigate(['video/' + _idSelected ]);
this.arianeService.setVideo(_idSelected);
}
}
}

View File

@ -1,11 +1,11 @@
<div class="main-reduce">
<div class="fill-all">
<div *ngFor="let data of groups" class="item" (click)="onSelectGroup(data)">
<div *ngFor="let data of groups" class="item" (click)="onSelectGroup($event, data)" (auxclick)="onSelectGroup($event, data)">
<app-element-group [id_type]="type_id" [id_group]="data"></app-element-group>
</div>
</div>
<div class="fill-all">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo(data)">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data)" (auxclick)="onSelectVideo($event, data)">
<app-element-video [id_video]="data"></app-element-video>
</div>
</div>

View File

@ -62,16 +62,23 @@ export class TypeComponent implements OnInit {
self.videos = []
});
}
onSelectGroup(_idSelected: number):void {
//this.router.navigate(['/type/' + this.type_id + '/group/' + _idSelected ]);
this.router.navigate(['/group/' + _idSelected ]);
this.arianeService.setGroup(_idSelected);
onSelectGroup(_event: any, _idSelected: number):void {
if(_event.which==2) {
window.open('/group/' + _idSelected);
} else {
this.router.navigate(['/group/' + _idSelected ]);
this.arianeService.setGroup(_idSelected);
}
}
onSelectVideo(_idSelected: number):void {
//this.router.navigate(['/type/' + this.type_id + '/video/' + _idSelected ]);
this.router.navigate(['/video/' + _idSelected ]);
this.arianeService.setVideo(_idSelected);
onSelectVideo(_event: any, _idSelected: number):void {
//console.log("event: " + _event.which);
if(_event.which==2) {
window.open('/video/' + _idSelected);
} else {
this.router.navigate(['/video/' + _idSelected ]);
this.arianeService.setVideo(_idSelected);
}
}
}

View File

@ -1,6 +1,6 @@
<div class="main-reduce">
<div class="fill-all">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo(data)">
<div *ngFor="let data of videos" class="item item-video" (click)="onSelectVideo($event, data)" (auxclick)="onSelectVideo($event, data)">
<app-element-video [id_video]="data"></app-element-video>
</div>
</div>

View File

@ -48,9 +48,13 @@ export class UniversComponent implements OnInit {
*/
}
onSelectVideo(_idSelected: number):void {
this.router.navigate(['video/' + _idSelected ]);
this.arianeService.setVideo(_idSelected);
onSelectVideo(_event: any, _idSelected: number):void {
if(_event.which==2) {
window.open('/video/' + _idSelected);
} else {
this.router.navigate(['video/' + _idSelected ]);
this.arianeService.setVideo(_idSelected);
}
}
}