(syncMode = false)
| 19 | } |
| 20 | |
| 21 | public openCorrection(syncMode = false): Promise<boolean> { |
| 22 | return new Promise((resolve, reject) => { |
| 23 | if (this.vueInstance) { |
| 24 | this.vueInstance.$.appContext.app.unmount(); |
| 25 | if (!syncMode) { |
| 26 | resolve(false); |
| 27 | return; |
| 28 | } |
| 29 | } |
| 30 | |
| 31 | const flasmessage = utils.flashm('<div class="ms-shadow"></div>', { |
| 32 | permanent: true, |
| 33 | position: 'top', |
| 34 | type: 'correction', |
| 35 | }); |
| 36 | |
| 37 | this.vueInstance = createApp(correctionApp, flasmessage.find('.ms-shadow').get(0)!, { |
| 38 | shadowDom: true, |
| 39 | }); |
| 40 | this.vueInstance.searchClass = this; |
| 41 | this.vueInstance.syncMode = syncMode; |
| 42 | this.vueInstance.unmountFnc = () => { |
| 43 | resolve(this.changed); |
| 44 | flasmessage.remove(); |
| 45 | this.vueInstance = undefined; |
| 46 | }; |
| 47 | |
| 48 | this.keyInterrupt(); |
| 49 | }); |
| 50 | } |
| 51 | |
| 52 | public isCorrectionMenuOpen() { |
| 53 | return j.$('.type-correction').length > 0; |
no test coverage detected