MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / pushToNavbar

Function pushToNavbar

src/pages/fileBrowser/fileBrowser.js:1510–1532  ·  view source on GitHub ↗

* Pushes a navigation button to navbar * @param {String} id * @param {String} name * @param {String} url

(name, url, action)

Source from the content-addressed store, hash-verified

1508 * @param {String} url
1509 */
1510 function pushToNavbar(name, url, action) {
1511 if (!url) return;
1512 const displayName = name || Url.basename(url) || url;
1513 $navigation.append(
1514 <span
1515 id={getNavId(url)}
1516 className="nav"
1517 data-url={url}
1518 data-name={displayName}
1519 attr-action="navigation"
1520 attr-text={displayName}
1521 tabIndex={-1}
1522 ></span>,
1523 );
1524 $navigation.scrollLeft = $navigation.scrollWidth;
1525
1526 if (action && !actionStack.has(url)) {
1527 actionStack.push({
1528 id: url,
1529 action,
1530 });
1531 }
1532 }
1533
1534 /**
1535 * Loads up given states

Callers 2

navigateFunction · 0.85
loadStatesFunction · 0.85

Calls 2

basenameMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected