|
|
|
@ -21,20 +21,20 @@
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
var tabTouchEnd = function (e) { |
|
|
|
|
|
|
|
|
|
window.addEventListener('touchend', function (e) { |
|
|
|
|
var activeTab; |
|
|
|
|
var activeBodies; |
|
|
|
|
var targetBody; |
|
|
|
|
var targetTab = getTarget(e.target); |
|
|
|
|
var className = 'active'; |
|
|
|
|
var classSelector = '.control-content.active'; |
|
|
|
|
var tabClassSelector = '.control-item.active'; |
|
|
|
|
var classSelector = '.' + className; |
|
|
|
|
|
|
|
|
|
if (!targetTab) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
activeTab = targetTab.parentNode.querySelector(tabClassSelector); |
|
|
|
|
activeTab = targetTab.parentNode.querySelector(classSelector); |
|
|
|
|
|
|
|
|
|
if (activeTab) { |
|
|
|
|
activeTab.classList.remove(className); |
|
|
|
@ -59,9 +59,12 @@
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
targetBody.classList.add(className); |
|
|
|
|
}; |
|
|
|
|
window.addEventListener('touchend', tabTouchEnd); |
|
|
|
|
window.addEventListener("MSPointerUp", tabTouchEnd); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
window.addEventListener('click', function (e) { |
|
|
|
|
if (getTarget(e.target)) { |
|
|
|
|
e.preventDefault(); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
window.addEventListener('click', function (e) { if (getTarget(e.target)) { preventDef(e); } }); |
|
|
|
|
}()); |
|
|
|
|