Commit 3572684b authored by 神楽坂玲奈's avatar 神楽坂玲奈

android 4.4 fix

parent 9b48080f
......@@ -74,6 +74,7 @@ md-card-content {
.icon {
font-size: 20px;
line-height: 24px;
}
#avatar /deep/ .mat-button-wrapper {
......
<!--https://github.com/google/material-design-icons/blob/master/iconfont/codepoints-->
<md-toolbar color="primary">
<button id="menu" md-icon-button (click)="ygopro.openDrawer()">
<md-icon>menu</md-icon>
......@@ -44,13 +46,13 @@
<md-icon>games</md-icon>
<br>房间列表</a></md-grid-tile>
<md-grid-tile><a md-raised-button color="primary" routerLink="/ygopro/rooms/new">
<md-icon>add_box</md-icon>
<md-icon>&#xe146;</md-icon><!--add_box-->
<br>创建房间</a></md-grid-tile>
<md-grid-tile><a md-raised-button routerLink="/ygopro/windbot">
<md-icon>airplanemode_active</md-icon>
<md-icon>&#xe195;</md-icon><!-- airplanemode_active -->
<br>单人模式</a></md-grid-tile>
<md-grid-tile><a md-raised-button routerLink="/ygopro/watch">
<md-icon>remove_red_eye</md-icon>
<md-icon>&#xe417;</md-icon><!--remove_red_eye-->
<br>观战</a></md-grid-tile>
<!--<md-grid-tile>-->
<!--<button md-raised-button (click)="ygopro.watch_replay()">-->
......@@ -75,7 +77,7 @@
</md-grid-tile>
</md-grid-list>
<md-card *ngIf="ygopro.points">
<md-card *ngIf="ygopro.points">
<md-grid-list id="points" cols="4" rowHeight="20px">
<md-grid-tile>
<dt>竞技排名</dt>
......
......@@ -7,12 +7,12 @@
</md-input-container>
<md-input-container *ngIf="room.private" class="full-width">
<md-placeholder>
<md-icon>vpn_key</md-icon>
<md-icon>&#xe0da;</md-icon><!-- vpn_key -->
<span>房间密码</span>
</md-placeholder>
<input #hostPasswordInput mdInput name="title" [(ngModel)]="host_password" readonly>
<button type="button" md-icon-button mdSuffix (click)="copy(host_password)">
<md-icon>content_copy</md-icon>
<md-icon>&#xe14d;</md-icon><!-- content_copy -->
</button>
<button type="button" md-icon-button mdSuffix (click)="share(host_password)">
<md-icon>share</md-icon>
......
<md-toolbar color="primary">
<button md-icon-button (click)="history.back()"><md-icon>arrow_back</md-icon></button>
<button md-icon-button (click)="history.back()">
<md-icon>&#xe5c4;</md-icon><!--arrow_back--></button>
<span><ng-content></ng-content></span>
</md-toolbar>
......@@ -3,7 +3,7 @@
<md-list>
<h3 md-subheader>选择对手</h3>
<md-list-item (click)="ygopro.join_windbot()">
<md-icon md-list-icon>airplanemode_active</md-icon>
<md-icon md-list-icon>&#xe195;</md-icon><!-- airplanemode_active -->
<h4 md-line>随机</h4>
</md-list-item>
<md-list-item *ngFor="let windbot of ygopro.windbot" (click)="ygopro.join_windbot(windbot)">
......
......@@ -207,28 +207,19 @@ export class YGOProService {
// 那些兼容性的垃圾事儿
// https://www.html5rocks.com/en/tutorials/pagevisibility/intro/
function getHiddenProp() {
const prefixes = ['webkit', 'moz', 'ms', 'o'];
// if 'hidden' is natively supported just return it
if ('hidden' in document) return 'hidden';
// otherwise loop over all the known prefixes until we find one
for (let i = 0; i < prefixes.length; i++) {
if ((prefixes[i] + 'Hidden') in document)
return prefixes[i] + 'Hidden';
}
// otherwise it's not supported
return null;
}
const visProp = getHiddenProp();
if (visProp) {
const evtname = visProp.replace(/[H|h]idden/, '') + 'visibilitychange';
Observable.fromEvent(document, evtname).subscribe(async () => !document[visProp] && this.load_result());
const hidden = ['hidden', 'webkitHidden', 'mozHidden', 'msHidden', 'oHidden'].find((prop) => prop in document);
if (hidden) {
const evtname = hidden.replace(/[H|h]idden/, '') + 'visibilitychange';
Observable.fromEvent(document, evtname).subscribe(() => {
if (!document[hidden]) {
this.load_result();
}
});
} else {
alert('调试信息1,看到的话请联系zh99998@gmail.com');
Observable.fromEvent(window, 'focus').subscribe(() => {
this.load_result();
});
}
}
......
......@@ -15,7 +15,7 @@
"node_modules/@types"
],
"lib": [
"es2016",
"es2017",
"dom.iterable"
]
}
......
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