Sha256: 93061c1af488b3ea6bc4d69e3696fdc3b056ce35ba0d3f558c58cbb0200b5c28

Contents?: true

Size: 472 Bytes

Versions: 12

Compression:

Stored size: 472 Bytes

Contents

import config from "../config";

export default function createSidebarStore(Alpine) {
  const { defaultWidth, minWidth, maxWidth } = config.sidebar;
  return {
    open: Alpine.$persist(true).as("sidebar-open"),
    width: Alpine.$persist(defaultWidth).as("sidebar-width"),
    panelSplits: Alpine.$persist([1.0, 1.0]).as(`sidebar-panel-splits`),
    minWidth,
    maxWidth,
    toggle() {
      Alpine.store("sidebar").open = !Alpine.store("sidebar").open;
    },
  };
}

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lookbook-0.8.0.beta.0 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.4 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.3 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.2 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.2.beta.5 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.2.beta.4 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.2.beta.3 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.2.beta.2 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.2.beta.1 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.2.beta.0 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.1 app/assets/lookbook/js/stores/sidebar.js
lookbook-0.7.0 app/assets/lookbook/js/stores/sidebar.js