src/canvas/index.js
/**
     * Initialize module. Automatically called with a new instance of the editor
     * @param {Object} config Configurations
     * @private
     */
Initialize module. Automatically called with a new instance of the editor
@param {Object} config Configurations
@private
Initialize module . Automatically called with a new instance of the editor @param { Object } config Configurations @private
init(config = {}) {
      c = {
        ...defaults,
        ...config
      };
      this.em = c.em;
      const ppfx = c.pStylePrefix;
      if (ppfx) c.stylePrefix = ppfx + c.stylePrefix;
      canvas = new Canvas(config);
      CanvasView = new canvasView({
        model: canvas,
        config: c
      });
      var cm = c.em.get('DomComponents');
      if (cm) this.setWrapper(cm);
      this.startAutoscroll = this.startAutoscroll.bind(this);
      this.stopAutoscroll = this.stopAutoscroll.bind(this);
      this.autoscroll = this.autoscroll.bind(this);
      this.updateClientY = this.updateClientY.bind(this);
      return this;
    }
init ( config = { } ) { c = { ... defaults , ... config } ; this . em = c . em ; const ppfx = c . pStylePrefix ; if ( ppfx ) c . stylePrefix = ppfx + c . stylePrefix ; canvas = new Canvas ( config ) ; CanvasView = new canvasView ( { model : canvas , config : c } ) ; var cm = c . em . get ( 'DomComponents' ) ; if ( cm ) this . setWrapper ( cm ) ; this . startAutoscroll = this . startAutoscroll . bind ( this ) ; this . stopAutoscroll = this . stopAutoscroll . bind ( this ) ; this . autoscroll = this . autoscroll . bind ( this ) ; this . updateClientY = this . updateClientY . bind ( this ) ; return this ; }
Initialize module.
Initialize module .