Skip to content

Commit

Permalink
Create new instance of web handle via master handle method
Browse files Browse the repository at this point in the history
Avoid code dependency.
Reduce size of jsroot.js
  • Loading branch information
linev committed Jul 17, 2024
1 parent 9970837 commit a1b6882
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 1 addition & 2 deletions modules/gpad/RCanvasPainter.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { RAxisPainter } from './RAxisPainter.mjs';
import { RFramePainter } from './RFramePainter.mjs';
import { RPadPainter } from './RPadPainter.mjs';
import { addDragHandler } from './TFramePainter.mjs';
import { WebWindowHandle } from '../webwindow.mjs';


/**
Expand Down Expand Up @@ -303,7 +302,7 @@ class RCanvasPainter extends RPadPainter {
if (!isFunc(this.showUI5Panel))
handle.send(reply + 'false');
else {
const conn = new WebWindowHandle(handle.kind);
const conn = handle.createNewInstance();

// set interim receiver until first message arrives
conn.setReceiver({
Expand Down
6 changes: 6 additions & 0 deletions modules/webwindow.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -810,6 +810,12 @@ class WebWindowHandle {
}
}

/** @summary Create new instance of same kind
* @private */
createNewInstance() {
return new WebWindowHandle(this.kind);
}

} // class WebWindowHandle


Expand Down

0 comments on commit a1b6882

Please sign in to comment.