How to use the @lrnwebcomponents/haxcms-elements/lib/core/haxcms-site-store.js.store.routerManifest function in @lrnwebcomponents/haxcms-elements

To help you get started, we’ve selected a few @lrnwebcomponents/haxcms-elements examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github elmsln / lrnwebcomponents / elements / simple-blog / lib / simple-blog-footer.js View on Github external
autorun(reaction => {
      this.manifest = toJS(store.routerManifest);
      if (varExists(this.manifest, "title")) {
        document.title = this.manifest.title;
      }
      if (varExists(this.manifest, "metadata.theme.variables.cssVariable")) {
        // json outline schema changed, allow other things to react
        // fake way of forcing an update of these items
        let ary = this.manifest.metadata.theme.variables.cssVariable
          .replace("--simple-colors-default-theme-", "")
          .split("-");
        ary.pop();
        this.accentColor = ary.join("-");
      }
      this.__disposer.push(reaction);
    });
    autorun(reaction => {
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / core / HAXCMSThemeWiring.js View on Github external
// dispatch to everything else caring
      const evt = new CustomEvent("json-outline-schema-active-item-changed", {
        bubbles: true,
        composed: true,
        cancelable: true,
        detail: newValue
      });
      this.dispatchEvent(evt);
      // update title as a simple nicity
      if (typeof newValue.title !== typeof undefined) {
        document.title = store.routerManifest.title + " - " + newValue.title;
      } else {
        document.title = store.routerManifest.title;
      }
    } else {
      document.title = store.routerManifest.title;
    }
  }
  /**
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / core / HAXCMSThemeWiring.js View on Github external
_locationChanged(newValue, oldValue) {
      if (!newValue || typeof newValue.route === "undefined") return;
      const location = newValue;
      const name = location.route.name;
      if (name == "home" || name == "404") {
        // if we are on the homepage then load the first item in the manifest
        // and set it active
        const firstItem = store.routerManifest.items.find(
          i => typeof i.id !== "undefined"
        );
        if (firstItem) {
          store.activeId = firstItem.id;
        }
      }
      if (this.HAXCMSThemeSettings.autoScroll) {
        window.scrollTo({
          top: 0,
          left: 0
        });
      }
    }
    /**
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / ui-components / site / site-print-button.js View on Github external
import("@lrnwebcomponents/haxcms-elements/lib/ui-components/layout/site-footer.js");
    const type = this.type;
    let content = "";
    if (type === "page") {
      // oh there you are
      content = `
      <h1>${store.activeItem.title}</h1>
      <div>${store.activeItemContent}</div>`;
    } else if (type === "parent") {
      // everything from the parent of this page, down
      const result = store.computeItems(
        1,
        100,
        store.activeId,
        "parent",
        store.routerManifest,
        true
      );
      for (var i in result) {
        content += await fetch("pages/" + result[i].location + "/index.html")
          .then(function(response) {
            return response.text();
          })
          .then(function(response) {
            let indent = result[i].indent + 1;
            if (indent &gt; 6) {
              indent = 6;
            }
            return `${result[i].title}
              ${response}`;
          });
      }
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / core / themes / haxcms-slide-theme.js View on Github external
autorun(reaction => {
      this.manifestLength = toJS(store.routerManifest.items.length);
      this.__disposer.push(reaction);
    });
    autorun(reaction => {
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / ui-components / navigation / site-menu.js View on Github external
autorun(reaction => {
      this.routerManifest = Object.assign({}, toJS(store.routerManifest));
      this.__disposer.push(reaction);
    });
    autorun(reaction => {
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / ui-components / query / site-query-menu-slice.js View on Github external
autorun(reaction => {
      this._routerManifest = Object.assign({}, toJS(store.routerManifest));
      this.__disposer.push(reaction);
    });
    if (!this.fixedId) {
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / ui-components / navigation / site-dot-indicator.js View on Github external
autorun(reaction => {
      this.routerManifest = toJS(store.routerManifest);
      this.__disposer.push(reaction);
    });
    autorun(reaction => {
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / ui-components / navigation / site-menu-button.js View on Github external
autorun(reaction => {
      this.routerManifest = toJS(store.routerManifest);
      this.__disposer.push(reaction);
    });
    autorun(reaction => {
github elmsln / lrnwebcomponents / elements / haxcms-elements / lib / ui-components / navigation / site-breadcrumb.js View on Github external
autorun(reaction => {
      this.manifest = toJS(store.routerManifest);
      this.__disposer.push(reaction);
    });
    autorun(reaction => {

@lrnwebcomponents/haxcms-elements

HAX CMS series of elements to provide a full on CMS

Apache-2.0
Latest version published 5 months ago

Package Health Score

69 / 100
Full package analysis

Popular @lrnwebcomponents/haxcms-elements functions