[Doc] optimzie router & remove unused code (#640)

This commit is contained in:
neverland
2018-02-12 17:23:37 +08:00
committed by GitHub
parent e1123c4116
commit 3991ec3bc9
28 changed files with 154 additions and 230 deletions
+26
View File
@@ -0,0 +1,26 @@
function iframeReady(iframe, callback) {
const doc = iframe.contentDocument || iframe.contentWindow.document;
const interval = () => {
if (iframe.contentWindow.changePath) {
callback();
} else {
setTimeout(() => {
interval();
}, 50);
}
};
if (doc.readyState === 'complete') {
interval();
} else {
iframe.onload = interval;
}
}
const ua = navigator.userAgent.toLowerCase();
const isMobile = /ios|iphone|ipod|ipad|android/.test(ua);
export {
isMobile,
iframeReady
};