 
     updated = true
 
-    if newMode != @popup[0].dataset.currentMode
-      @popup[0].dataset.currentMode = newMode
-      @popup[0].dataset.currentSubMode = newSubMode
-    else if newSubMode != @popup[0].dataset.currentSubMode
-      @popup[0].dataset.currentSubMode = newSubMode
+    if newMode != @data().currentMode
+      @data().currentMode = newMode
+      @data().currentSubMode = newSubMode
+    else if newSubMode != @data().currentSubMode
+      @data().currentSubMode = newSubMode
     else
       updated = false
 

    e.stopPropagation()

    if @setMode e.currentTarget.dataset
      @showPopup() unless @visible
    else
      @hidePopup()

    activeClass = 'js-nav-switch--active'

    for menu in @menus
      if @data().visible
        menu.classList.add animateClass
      else
        menu.classList.remove animateClass
