Browse Source

Revert "Fixed "active" class bug with toggle"

This reverts commit 790d5300b0.
pull/839/head
thewax 9 years ago
parent
commit
5ca4ef5259
  1. 19
      js/segmented-controllers.js

19
js/segmented-controllers.js

@ -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); } });
}());

Loading…
Cancel
Save