How to use the golden-layout.__lm function in golden-layout

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

github Azure-Samples / digital-twins-explorer / client / src / components / GoldenLayoutComponent / GoldenLayoutComponent.js View on Github external
if (current.isComponent && current.config.id === componentName) {
        current.remove();
        break;
      }

      if (current.contentItems) {
        current.contentItems.forEach(x => items.push(x));
      }
    }
  }

}

//Patching internal GoldenLayout.__lm.utils.ReactComponentHandler:

const ReactComponentHandler = GoldenLayout.__lm.utils.ReactComponentHandler;

class ReactComponentHandlerPatched extends ReactComponentHandler {

  _render() {
    // Instance of GoldenLayoutComponent class
    const reactContainer = this._container.layoutManager.reactContainer;
    if (reactContainer && reactContainer.componentRender) {
      reactContainer.componentRender(this);
    }
  }

  _destroy() {
    this._container.off("open", this._render, this);
    this._container.off("destroy", this._destroy, this);
  }
github Azure-Samples / digital-twins-explorer / client / src / components / GoldenLayoutComponent / GoldenLayoutComponent.js View on Github external
this._container.off("destroy", this._destroy, this);
  }

  _getReactComponent() {
    // The following method is absolute copy of the original, provided to prevent depenency on window.React
    const defaultProps = {
      glEventHub: this._container.layoutManager.eventHub,
      glContainer: this._container
    };
    const props = $.extend(defaultProps, this._container._config.props);
    return React.createElement(this._reactClass, props);
  }

}

GoldenLayout.__lm.utils.ReactComponentHandler = ReactComponentHandlerPatched;

golden-layout

A multi-screen javascript Layout manager

MIT
Latest version published 1 day ago

Package Health Score

82 / 100
Full package analysis

Similar packages