Browse Source

Fixed "active" class bug with toggle within a segmented control body (fixed older commit)

pull/839/head
thewax 9 years ago
parent
commit
52f18a12c0
  1. 5
      js/segmented-controllers.js

5
js/segmented-controllers.js

@ -28,13 +28,14 @@
var targetBody; var targetBody;
var targetTab = getTarget(e.target); var targetTab = getTarget(e.target);
var className = 'active'; var className = 'active';
var classSelector = '.' + className; var classSelector = '.control-content.' + className;
var tabClassSelector = '.control-item.' + className;
if (!targetTab) { if (!targetTab) {
return; return;
} }
activeTab = targetTab.parentNode.querySelector(classSelector); activeTab = targetTab.parentNode.querySelector(tabClassSelector);
if (activeTab) { if (activeTab) {
activeTab.classList.remove(className); activeTab.classList.remove(className);

Loading…
Cancel
Save