code: function(e) {
                  var element = $(e.target),
                      parent = element[0].parentNode,
                      parentLink,
                      elementIconChild;
                  if (parent) {
                      if (!$(parent).hasClass('linked')) {
                          e.preventDefault();
                      } else {
                          parentLink = parent.parentNode;
                          if (parentLink && element.hasClass('link-name')) {
                              $(parentLink).trigger('click');
                          }
                      }
                      elementIconChild = parent.getElementsByClassName(faAngleUpClass)[0];
                      if (!elementIconChild) {
                          elementIconChild = parent.getElementsByClassName(faAngleDownClass)[0];
                      }
                      if (elementIconChild) {
                          elementIconChild = $(elementIconChild);
                          if (elementIconChild.hasClass(faAngleUpClass)) {
                              elementIconChild.addClass(faAngleDownClass);
                              elementIconChild.removeClass(faAngleUpClass);
                          } else {
                              elementIconChild.addClass(faAngleUpClass);
                              elementIconChild.removeClass(faAngleDownClass);
                          }
                      }
                  }
              }
docs: collapse menu