Sha256: a73a027c08fbb5185d4c0b3ec79e720c704bebb167deced2cade3129f28faab8

Contents?: true

Size: 627 Bytes

Versions: 5

Compression:

Stored size: 627 Bytes

Contents

import Split from "split-grid";

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

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
lookbook-0.2.4 app/assets/lookbook/js/split.js
lookbook-0.2.3 app/assets/lookbook/js/split.js
lookbook-0.2.2 app/assets/lookbook/js/split.js
lookbook-0.2.1 app/assets/lookbook/js/split.js
lookbook-0.2.0 app/assets/lookbook/js/split.js