Sha256: 707ac9a49c60a68ad1443ecbb1fb34478621a102796cfc2ec738509df63c46b1

Contents?: true

Size: 681 Bytes

Versions: 25

Compression:

Stored size: 681 Bytes

Contents

import Split from "split-grid";

export default function splitter(direction, props = {}) {
  return {
    splits: [],
    init() {
      const type = `${direction === "vertical" ? "column" : "row"}Gutters`;
      const element = this.$el;
      Split({
        [type]: [{ track: 1, element }],
        minSize: props.minSize || 0,
        writeStyle() {},
        onDrag: (dir, track, style) => {
          this.splits = style.split(" ").map((num) => parseFloat(num, 10));
        },
        onDragStart: () => {
          this.$store.layout.reflowing = true;
        },
        onDragEnd: () => {
          this.$store.layout.reflowing = false;
        },
      });
    },
  };
}

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
lookbook-0.9.8 app/assets/lookbook/js/components/splitter.js
lookbook-0.9.7 app/assets/lookbook/js/components/splitter.js
lookbook-0.9.6 app/assets/lookbook/js/components/splitter.js
lookbook-0.9.5 app/assets/lookbook/js/components/splitter.js
lookbook-0.9.4 app/assets/lookbook/js/components/splitter.js
lookbook-0.9.3 app/assets/lookbook/js/components/splitter.js
lookbook-0.9.2 app/assets/lookbook/js/components/splitter.js
lookbook-0.9.1 app/assets/lookbook/js/components/splitter.js
lookbook-0.9.0 app/assets/lookbook/js/components/splitter.js
lookbook-0.8.3 app/assets/lookbook/js/components/splitter.js
lookbook-0.8.2 app/assets/lookbook/js/components/splitter.js
lookbook-0.8.1 app/assets/lookbook/js/components/splitter.js
lookbook-0.8.0 app/assets/lookbook/js/components/splitter.js
lookbook-0.8.0.beta.0 app/assets/lookbook/js/components/splitter.js
lookbook-0.7.4 app/assets/lookbook/js/components/splitter.js
lookbook-0.7.3 app/assets/lookbook/js/components/splitter.js
lookbook-0.7.2 app/assets/lookbook/js/components/splitter.js
lookbook-0.7.2.beta.5 app/assets/lookbook/js/components/splitter.js
lookbook-0.7.2.beta.4 app/assets/lookbook/js/components/splitter.js
lookbook-0.7.2.beta.3 app/assets/lookbook/js/components/splitter.js