MCPcopy Create free account
hub / github.com/compiler-explorer/compiler-explorer / addInEditorStackIfPossible

Method addInEditorStackIfPossible

static/hub.ts:382–391  ·  view source on GitHub ↗
(elem: GoldenLayout.ItemConfig)

Source from the content-addressed store, hash-verified

380 }
381
382 public addInEditorStackIfPossible(elem: GoldenLayout.ItemConfig): void {
383 const insertionPoint = this.findEditorParentRowOrColumn();
384 // required not-true check because findEditorParentRowOrColumn returns
385 // false if there is no editor parent
386 if (insertionPoint && insertionPoint !== true) {
387 insertionPoint.addChild(elem);
388 } else {
389 this.addAtRoot(elem);
390 }
391 }
392
393 public addAtRoot(elem: GoldenLayout.ItemConfig): void {
394 if (this.layout.root.contentItems.length > 0) {

Callers 3

setupAddFunction · 0.80
editFileMethod · 0.80
bindClickToOpenPaneMethod · 0.80

Calls 2

addAtRootMethod · 0.95

Tested by

no test coverage detected