Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 105c245

Browse files
Merge branch 'vuejs.org-master' into 2.0-cn
# Conflicts: # src/v2/guide/comparison.md
2 parents 5172a05 + f4125ac commit 105c245

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

‎themes/vue/layout/partials/header.ejs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<div id="header">
22
<a id="logo" href="/">
33
<img src="/images/logo.png">
4-
<span>Vue.js <span style="font-size: 12px;">(2017.02.19更新,合并vuejs.org更新!)</span></span>
4+
<span>Vue.js <span style="font-size: 12px;">(2017.02.20更新,合并vuejs.org更新!)</span></span>
55
</a>
66
<a style="
77
position: absolute;

‎themes/vue/source/js/common.js‎

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
}
9393

9494
/**
95-
* Mobile burger menu button for toggling sidebar
95+
* Mobile burger menu button and gesture for toggling sidebar
9696
*/
9797

9898
function initMobileMenu () {
@@ -109,6 +109,27 @@
109109
sidebar.classList.remove('open')
110110
}
111111
})
112+
113+
// Toggle sidebar on swipe
114+
var start = {}, end = {}
115+
116+
document.body.addEventListener('touchstart', function (e) {
117+
start.x = e.changedTouches[0].clientX
118+
start.y = e.changedTouches[0].clientY
119+
})
120+
121+
document.body.addEventListener('touchend', function (e) {
122+
end.y = e.changedTouches[0].clientY
123+
end.x = e.changedTouches[0].clientX
124+
125+
var xDiff = end.x - start.x
126+
var yDiff = end.y - start.y
127+
128+
if (Math.abs(xDiff) > Math.abs(yDiff)) {
129+
if (xDiff > 0) sidebar.classList.add('open')
130+
else sidebar.classList.remove('open')
131+
}
132+
})
112133
}
113134

114135
/**

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /