add PullRefresh component

This commit is contained in:
陈嘉涵
2017-09-07 11:10:12 +08:00
parent 527e12768b
commit 9eb825f54d
9 changed files with 476 additions and 11 deletions
+11 -10
View File
@@ -23,18 +23,19 @@ window.changePath = function(path) {
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') {
callback();
interval();
} else {
const interval = () => {
if (iframe.contentWindow.changePath) {
callback();
} else {
setTimeout(() => {
interval();
}, 50);
}
};
iframe.onload = interval;
}
}