How to use the react-mosaic-component/lib/util/mosaicUtilities.getOtherDirection function in react-mosaic-component

To help you get started, we’ve selected a few react-mosaic-component examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ProjectMirador / mirador / src / lib / MosaicLayout.js View on Github external
addedWindowIds.forEach((windowId, i) => {
      const path = this.pathToCorner();
      const parent = this.pathToParent(path);
      const destination = this.nodeAtPath(path);
      const direction = parent ? getOtherDirection(parent.direction) : 'row';
      let first;
      let second;
      if (direction === 'row') {
        first = destination;
        second = addedWindowIds[i];
      } else {
        first = addedWindowIds[i];
        second = destination;
      }
      const update = {
        path,
        spec: {
          $set: {
            direction,
            first,
            second,