title: Menu toggle working on second click
body: <p>Menu toggle working on second click. If it is opened sometimes it goes away. It is not consistent. </p>
  
  <pre><code>f("#smt, #smp .s-panel--close").on("click", function(s) {
      s.preventDefault();
      A.toggleClass("sidemenu-opened")
  });
  f("#mmt, #main-nav-mobile .s-panel--close").on("click", function(s) {
      s.preventDefault();
      A.toggleClass("mm-opened")
  });
  f(".bs-docs-example").each(function(s, K) {
      var J = f(K),
          L = '&lt;a href="#" class="togglecode"&gt;&lt;/a&gt;';
      if (J.next().is("pre")) {
          J.addClass("withcode");
          J.append(L);
          J.find(".togglecode").on("click", function(M) {
              M.preventDefault();
              J.toggleClass("opened")
          })
      }
  });
  </code></pre>
  
  <p>HTML:</p>
  
  <pre><code> &lt;li&gt;
      &lt;a href="javascript:void(0);" id="smt" class="headericon mobilenav-icon"&gt;&lt;span&gt;&lt;/span&gt;&lt;/a&gt;
      &lt;/li&gt;
  </code></pre>