Sha256: ad6333c84464b26707b845db867db786187d049ec6595a9dbf4f9067f6a0292c

Contents?: true

Size: 637 Bytes

Versions: 17

Compression:

Stored size: 637 Bytes

Contents

import Split from "split-grid";

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

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
lookbook-0.4.6 app/assets/lookbook/js/utils/split.js
lookbook-0.4.5 app/assets/lookbook/js/utils/split.js
lookbook-0.4.4 app/assets/lookbook/js/utils/split.js
lookbook-0.4.3 app/assets/lookbook/js/utils/split.js
lookbook-0.4.2 app/assets/lookbook/js/utils/split.js
lookbook-0.4.1 app/assets/lookbook/js/utils/split.js
lookbook-0.3.5 app/assets/lookbook/js/utils/split.js
lookbook-0.4.0.beta.2 app/assets/lookbook/js/utils/split.js
lookbook-0.4.0.beta.1 app/assets/lookbook/js/utils/split.js
lookbook-0.3.4 app/assets/lookbook/js/utils/split.js
lookbook-0.3.3 app/assets/lookbook/js/utils/split.js
lookbook-0.3.2 app/assets/lookbook/js/utils/split.js
lookbook-0.3.1 app/assets/lookbook/js/utils/split.js
lookbook-0.3.0 app/assets/lookbook/js/utils/split.js
lookbook-0.3.0.beta.2 app/assets/lookbook/js/utils/split.js
lookbook-0.3.0.beta.1 app/assets/lookbook/js/utils/split.js
lookbook-0.3.0.beta.0 app/assets/lookbook/js/utils/split.js