INNER CODE UNIT · JavaScript

categoryNameOf

smithyhq/sqladmin · sqladmin/statics/js/main.js:659

  function categoryNameOf(element) {
    var item = element && element.closest
      ? element.closest('[data-sqladmin-menu-category]')
      : null;
    return item ? item.getAttribute('data-sqladmin-menu-category') : null;
  }

  function rememberCategory(name, isExpanded) {
    var names = readExpanded().filter(function (stored) { return stored !== name; });
    if (isExpanded) names.push(name);
    writeExpanded(names);
  }

  // Bootstrap marks both the toggle and the menu with `show`, and reads the
  // class back off the toggle to decide what a click should do. Restoring only
  // one of the two makes the next click a no-op.
  var expanded = readExpanded();
  Array.prototype.forEach.call(

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…