Commit 38b0ad61 authored by mercury233's avatar mercury233

fix dropdown menu

parent 9bff4db4
......@@ -227,37 +227,37 @@
<th class="mode">
<!--<span i18n>游戏模式</span>-->
<div id="watch-filter" class="dropdown">
<button i18n class="btn btn-secondary dropdown-toggle btn-sm" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button i18n class="btn btn-secondary dropdown-toggle btn-sm" type="button" id="watchDropdownMenuButton" aria-haspopup="true" aria-expanded="false">
游戏模式
</button>
<div class="dropdown-menu">
<h6 i18n class="dropdown-header">匹配</h6>
<div class="form-check dropdown-item">
<input id="filter-athletic" type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.athletic" (change)="refresh_replay_rooms()">
<label i18n for="filter-athletic" class="form-check-label">竞技匹配</label>
</div>
<div class="form-check dropdown-item">
<input id="filter-entertain" type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.entertain" (change)="refresh_replay_rooms()">
<label i18n for="filter-entertain" class="form-check-label">娱乐匹配</label>
</div>
<label i18n class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.athletic">
竞技匹配
</label>
<label i18n class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.entertain">
娱乐匹配
</label>
<h6 i18n class="dropdown-header">自定义游戏</h6>
<div class="form-check dropdown-item">
<input id="filter-single" type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.single" (change)="refresh_replay_rooms()">
<label i18n for="filter-single" class="form-check-label">单局模式</label>
</div>
<div class="form-check dropdown-item">
<input id="filter-match" type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.match" (change)="refresh_replay_rooms()">
<label i18n for="filter-match" class="form-check-label">比赛模式</label>
</div>
<div class="form-check dropdown-item">
<input id="filter-tag" type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.tag" (change)="refresh_replay_rooms()">
<label i18n for="filter-tag" class="form-check-label">TAG</label>
</div>
<label i18n class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.single">
单局模式
</label>
<label i18n class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.match">
比赛模式
</label>
<label i18n class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.tag">
TAG
</label>
<h6 i18n class="dropdown-header">单人模式</h6>
<div class="form-check dropdown-item">
<input id="filter-windbot" type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.windbot" (change)="refresh_replay_rooms()">
<label i18n for="filter-windbot" class="form-check-label">单人模式</label>
</div>
<label i18n class="form-check dropdown-item">
<input type="checkbox" class="form-check-input" [(ngModel)]="replay_rooms_filter.windbot">
单人模式
</label>
</div>
</div>
</th>
......
......@@ -388,6 +388,23 @@ export class YGOProComponent implements OnInit, OnDestroy {
this.replay_connections = [];
});
let watchDropdownMenu = $('#watch-filter');
watchDropdownMenu.on("change", "input[type='checkbox']", (event) => {
//$(event.target).closest("label").toggleClass("active", (<HTMLInputElement> event.target).checked);
this.refresh_replay_rooms();
});
replay_modal.on('click', (event) => {
if (!watchDropdownMenu.is(event.target) && !watchDropdownMenu.has(event.target).length) {
watchDropdownMenu.removeClass('show');
}
});
$('#watchDropdownMenuButton').on('click', () => {
watchDropdownMenu.toggleClass('show');
});
remote.ipcMain.on('YGOPro', (e: any, type: string) => {
console.log('rrrrr');
this.request_match(type);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment