MCPcopy Index your code
hub / github.com/compiler-explorer/compiler-explorer / initButtons

Method initButtons

static/sharing.ts:295–307  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

293 }
294
295 private initButtons(): void {
296 const shareShortCopyToClipBtn = this.shareShort.find('.clip-icon');
297 const shareFullCopyToClipBtn = this.shareFull.find('.clip-icon');
298 const shareEmbedCopyToClipBtn = this.shareEmbed.find('.clip-icon');
299
300 shareShortCopyToClipBtn.on('click', e => this.onClipButtonPressed(e, LinkType.Short));
301 shareFullCopyToClipBtn.on('click', e => this.onClipButtonPressed(e, LinkType.Full));
302 shareEmbedCopyToClipBtn.on('click', e => this.onClipButtonPressed(e, LinkType.Embed));
303
304 if (options.sharingEnabled) {
305 Sharing.updateShares($('#socialshare'), window.location.protocol + '//' + window.location.hostname);
306 }
307 }
308
309 private onClipButtonPressed(event: ClickEvent, type: LinkType): boolean {
310 // Don't let the modal show up.

Callers 1

constructorMethod · 0.95

Calls 4

onClipButtonPressedMethod · 0.95
findMethod · 0.80
updateSharesMethod · 0.80
onMethod · 0.45

Tested by

no test coverage detected