MCPcopy
hub / github.com/compiler-explorer/compiler-explorer / constructor

Method constructor

static/sharing.ts:155–174  ·  view source on GitHub ↗
(layout: GoldenLayout)

Source from the content-addressed store, hash-verified

153 private readonly shareLinkDialog: HTMLElement;
154
155 constructor(layout: GoldenLayout) {
156 super(layout);
157 this.shareLinkDialog = unwrap(document.getElementById('sharelinkdialog'), 'Share modal element not found');
158
159 this.share = $('#share');
160 this.shareTooltipTarget = $('#share-tooltip-target');
161 this.shareShort = $('#shareShort');
162 this.shareFull = $('#shareFull');
163 this.shareEmbed = $('#shareEmbed');
164
165 [this.shareShort, this.shareFull, this.shareEmbed].forEach(el => {
166 el.on('click', e => BootstrapUtils.showModal(this.shareLinkDialog, e.currentTarget));
167 });
168 this.settings = Settings.getStoredSettings();
169
170 this.clippyButton = null;
171
172 this.initButtons();
173 this.initFullCallbacks();
174 }
175
176 private initFullCallbacks(): void {
177 this.layout.eventHub.on('displaySharingPopover', () => {

Callers

nothing calls this directly

Calls 5

initButtonsMethod · 0.95
initFullCallbacksMethod · 0.95
getStoredSettingsMethod · 0.80
unwrapFunction · 0.50
onMethod · 0.45

Tested by

no test coverage detected