Skip to content

Commit 0795c1a

Browse files
author
zhangxinxu
committed
test safari slide
test safari slide
1 parent 56fbfe3 commit 0795c1a

File tree

3 files changed

+13
-8
lines changed

3 files changed

+13
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "mobilebone",
3-
"version": "2.3.3",
3+
"version": "2.3.4",
44
"description": "Bone main for mobile web APP with a sigle page mode.",
55
"main": "src/mobilebone.js",
66
"directories": {

src/mobilebone.js

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
*
3939
* @type string
4040
**/
41-
Mobilebone.VERSION = '2.3.3';
41+
Mobilebone.VERSION = '2.3.4';
4242

4343
/**
4444
* Whether catch attribute of href from element with tag 'a'
@@ -269,7 +269,7 @@
269269
}
270270
// Fastclick may cause slide bug in iOS8, any innerHTML change can fix it!
271271
// issues #80
272-
if (typeof FastClick != "undefined") {
272+
//if (typeof FastClick != "undefined") {
273273
var mobilebone = document.querySelector("mobilebone");
274274
if (mobilebone == null) {
275275
mobilebone = document.createElement("mobilebone");
@@ -278,7 +278,7 @@
278278
document.body.appendChild(mobilebone);
279279
}
280280
mobilebone.innerHTML = mobilebone.innerHTML.replace('11', '') + '1';
281-
}
281+
//}
282282

283283
// delete page with same id when options.remove !== false
284284
var pageid = options.id || pageInto.id;
@@ -339,12 +339,16 @@
339339
});
340340

341341
// history
342-
var url_push = pageid;
342+
var url_push = pageid, url_push_replaced = '';
343343
if (url_push && /^#/.test(url_push) == false) {
344344
url_push = "#" + url_push;
345345
}
346-
347-
if (supportHistory && this.pushStateEnabled && options.history !== false && url_push) {
346+
url_push_replaced = url_push.replace(/^#/, "#&");
347+
348+
if (supportHistory && this.pushStateEnabled && options.history !== false && url_push
349+
// hash should be different
350+
&& url_push_replaced != location.hash
351+
) {
348352
// don't trigger 'popstate' events
349353
history.popstate = false;
350354
// if only pageIn, use 'replaceState'

test/ajax-html/c.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@
77
<body>
88
<div class="page out">
99
<ul>
10-
<li><a href="#pageHome" data-rel="back">c页面,直接刷新,浏览器返回</a></li>
10+
<li><a href="#pageHome" data-rel="back">c页面,浏览器返回</a></li>
11+
<li><a href="" data-rel="back">再次加重c页面</a></li>
1112
<li><a href="javascript:" data-rel="back">直接返回b页面</a></li>
1213
</ul>
1314
</div>

0 commit comments

Comments
 (0)