Skip to content

Commit 01a3646

Browse files
committed
Merge pull request #102 from zhangxinxu/develop
fix reload bug caused by mobilebone repeat loaded
2 parents dae80e6 + 330e32b commit 01a3646

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/mobilebone.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@
1616
root.Mobilebone = factory(root, {});
1717
}
1818
})(this, function(root, Mobilebone) {
19+
if (document.MBLOADED) {
20+
return 'Don\'t repeat load Mobilebone!';
21+
}
22+
1923
// Avoid repeated callbacks
2024
var store = {};
2125

@@ -30,7 +34,7 @@
3034
var supportHistory = "pushState" in history && "replaceState" in history;
3135

3236
Mobilebone.support = supportHistory;
33-
37+
3438
var hasInited = false;
3539

3640
/**
@@ -1164,6 +1168,8 @@
11641168
});
11651169
}
11661170
});
1171+
1172+
document.MBLOADED = true;
11671173

11681174
return Mobilebone;
11691175
});

test/ajax-html/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
</div>
4040

4141
<script src="../../src/mobilebone.js"></script>
42-
<script src="../complex/js/zepto-docs.js"></script>
42+
<script src="../../src/mobilebone.js"></script>
4343
<script>
4444
var optionsTest = function(elein, eleout, options) {
4545
// ajax过场回调options参数测试

0 commit comments

Comments
 (0)