Sha256: a012eca968a6459344a11d2a079632a07119011fcd4a6773efda70e56805b734

Contents?: true

Size: 417 Bytes

Versions: 2

Compression:

Stored size: 417 Bytes

Contents

import morph from "morphdom";

export default function (from, to, opts = {}) {
  morph(from, to, {
    onBeforeElUpdated: function (fromEl, toEl) {
      if (fromEl._x_dataStack) {
        Alpine.clone(fromEl, toEl);
      }
      if (fromEl.isEqualNode(toEl)) {
        return false;
      }
      if (fromEl.hasAttribute("skip-morph")) {
        return false;
      }
      return true;
    },
    ...opts,
  });
}

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
lookbook-0.4.6 app/assets/lookbook/js/utils/morph.js
lookbook-0.4.5 app/assets/lookbook/js/utils/morph.js