Merge pull request #173 from coxchen/master

Fixed a bug in Segmented controller when swapping content sections back and forth
This commit is contained in:
Connor Sears 2013-09-14 14:45:28 -07:00
Родитель c9e0f495f4 40b809de65
Коммит 52b59b07ba
2 изменённых файлов: 12 добавлений и 8 удалений

10
dist/ratchet.js поставляемый
Просмотреть файл

@ -527,7 +527,7 @@
window.addEventListener("touchend", function (e) {
var activeTab;
var activeBody;
var activeBodies;
var targetBody;
var targetTab;
var className = 'active';
@ -549,11 +549,13 @@
if (!targetBody) return;
activeBody = targetBody.parentNode.querySelector(classSelector);
activeBodies = targetBody.parentNode.querySelectorAll(classSelector);
if (activeBody) activeBody.classList.remove(className);
for (var i = 0; i < activeBodies.length; i++) {
activeBodies[i].classList.remove(className);
}
targetBody.classList.add(className)
targetBody.classList.add(className);
});
window.addEventListener('click', function (e) { if (getTarget(e.target)) e.preventDefault(); });

Просмотреть файл

@ -14,7 +14,7 @@
window.addEventListener("touchend", function (e) {
var activeTab;
var activeBody;
var activeBodies;
var targetBody;
var targetTab;
var className = 'active';
@ -36,11 +36,13 @@
if (!targetBody) return;
activeBody = targetBody.parentNode.querySelector(classSelector);
activeBodies = targetBody.parentNode.querySelectorAll(classSelector);
if (activeBody) activeBody.classList.remove(className);
for (var i = 0; i < activeBodies.length; i++) {
activeBodies[i].classList.remove(className);
}
targetBody.classList.add(className)
targetBody.classList.add(className);
});
window.addEventListener('click', function (e) { if (getTarget(e.target)) e.preventDefault(); });