()
| 174 | } |
| 175 | |
| 176 | private initFullCallbacks(): void { |
| 177 | this.layout.eventHub.on('displaySharingPopover', () => { |
| 178 | this.openShareModalForType(LinkType.Short); |
| 179 | }); |
| 180 | this.layout.eventHub.on('copyShortLinkToClip', () => { |
| 181 | this.copyLinkTypeToClipboard(LinkType.Short); |
| 182 | }); |
| 183 | |
| 184 | this.shareLinkDialog.addEventListener('show.bs.modal', this.onOpenModalPane.bind(this)); |
| 185 | this.shareLinkDialog.addEventListener('hidden.bs.modal', this.onCloseModalPane.bind(this)); |
| 186 | |
| 187 | this.layout.eventHub.on('settingsChange', (newSettings: SiteSettings) => { |
| 188 | this.settings = newSettings; |
| 189 | }); |
| 190 | |
| 191 | $(window).on('blur', async () => { |
| 192 | sessionThenLocalStorage.set('gl', JSON.stringify(this.layout.toConfig())); |
| 193 | if (this.settings.keepMultipleTabs) { |
| 194 | try { |
| 195 | const link = await this.getLinkOfType(LinkType.Full); |
| 196 | window.history.replaceState(null, '', link); |
| 197 | } catch (e) { |
| 198 | // This is probably caused by a link that is too long |
| 199 | SentryCapture(e, 'url update'); |
| 200 | } |
| 201 | } |
| 202 | }); |
| 203 | } |
| 204 | |
| 205 | private static bindToLinkType(bind: string): LinkType { |
| 206 | switch (bind) { |
no test coverage detected