Rename Popup.setVisible to setVisibleOverride
This commit is contained in:
parent
bac237336e
commit
2255fadf52
@ -527,8 +527,8 @@ Frontend.runtimeMessageHandlers = {
|
|||||||
self.updateOptions();
|
self.updateOptions();
|
||||||
},
|
},
|
||||||
|
|
||||||
popupSetVisible: (self, {visible}) => {
|
popupSetVisibleOverride: (self, {visible}) => {
|
||||||
self.popup.setVisible(visible);
|
self.popup.setVisibleOverride(visible);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -41,7 +41,7 @@ class PopupProxyHost {
|
|||||||
show: ({id, elementRect, options}) => this.show(id, elementRect, options),
|
show: ({id, elementRect, options}) => this.show(id, elementRect, options),
|
||||||
showOrphaned: ({id, elementRect, options}) => this.show(id, elementRect, options),
|
showOrphaned: ({id, elementRect, options}) => this.show(id, elementRect, options),
|
||||||
hide: ({id, changeFocus}) => this.hide(id, changeFocus),
|
hide: ({id, changeFocus}) => this.hide(id, changeFocus),
|
||||||
setVisible: ({id, visible}) => this.setVisible(id, visible),
|
setVisibleOverride: ({id, visible}) => this.setVisibleOverride(id, visible),
|
||||||
containsPoint: ({id, x, y}) => this.containsPoint(id, x, y),
|
containsPoint: ({id, x, y}) => this.containsPoint(id, x, y),
|
||||||
termsShow: ({id, elementRect, writingMode, definitions, options, context}) => this.termsShow(id, elementRect, writingMode, definitions, options, context),
|
termsShow: ({id, elementRect, writingMode, definitions, options, context}) => this.termsShow(id, elementRect, writingMode, definitions, options, context),
|
||||||
kanjiShow: ({id, elementRect, writingMode, definitions, options, context}) => this.kanjiShow(id, elementRect, writingMode, definitions, options, context),
|
kanjiShow: ({id, elementRect, writingMode, definitions, options, context}) => this.kanjiShow(id, elementRect, writingMode, definitions, options, context),
|
||||||
@ -103,9 +103,9 @@ class PopupProxyHost {
|
|||||||
return popup.hide(changeFocus);
|
return popup.hide(changeFocus);
|
||||||
}
|
}
|
||||||
|
|
||||||
async setVisible(id, visible) {
|
async setVisibleOverride(id, visible) {
|
||||||
const popup = this.getPopup(id);
|
const popup = this.getPopup(id);
|
||||||
return popup.setVisible(visible);
|
return popup.setVisibleOverride(visible);
|
||||||
}
|
}
|
||||||
|
|
||||||
async containsPoint(id, x, y) {
|
async containsPoint(id, x, y) {
|
||||||
|
@ -65,9 +65,9 @@ class PopupProxy {
|
|||||||
return await this.invokeHostApi('hide', {id: this.id, changeFocus});
|
return await this.invokeHostApi('hide', {id: this.id, changeFocus});
|
||||||
}
|
}
|
||||||
|
|
||||||
async setVisible(visible) {
|
async setVisibleOverride(visible) {
|
||||||
const id = await this.getPopupId();
|
const id = await this.getPopupId();
|
||||||
return await this.invokeHostApi('setVisible', {id, visible});
|
return await this.invokeHostApi('setVisibleOverride', {id, visible});
|
||||||
}
|
}
|
||||||
|
|
||||||
async containsPoint(x, y) {
|
async containsPoint(x, y) {
|
||||||
|
@ -238,7 +238,7 @@ class Popup {
|
|||||||
return this.isInjected && this.container.style.visibility !== 'hidden';
|
return this.isInjected && this.container.style.visibility !== 'hidden';
|
||||||
}
|
}
|
||||||
|
|
||||||
setVisible(visible) {
|
setVisibleOverride(visible) {
|
||||||
if (visible) {
|
if (visible) {
|
||||||
this.container.style.setProperty('display', '');
|
this.container.style.setProperty('display', '');
|
||||||
} else {
|
} else {
|
||||||
|
@ -445,7 +445,7 @@ class Display {
|
|||||||
|
|
||||||
async getScreenshot() {
|
async getScreenshot() {
|
||||||
try {
|
try {
|
||||||
await this.setPopupVisible(false);
|
await this.setPopupVisibleOverride(false);
|
||||||
await Display.delay(1); // Wait for popup to be hidden.
|
await Display.delay(1); // Wait for popup to be hidden.
|
||||||
|
|
||||||
const {format, quality} = this.options.anki.screenshot;
|
const {format, quality} = this.options.anki.screenshot;
|
||||||
@ -454,7 +454,7 @@ class Display {
|
|||||||
|
|
||||||
return {dataUrl, format};
|
return {dataUrl, format};
|
||||||
} finally {
|
} finally {
|
||||||
await this.setPopupVisible(true);
|
await this.setPopupVisibleOverride(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -462,8 +462,8 @@ class Display {
|
|||||||
return this.options.general.resultOutputMode === 'merge' ? 0 : -1;
|
return this.options.general.resultOutputMode === 'merge' ? 0 : -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
setPopupVisible(visible) {
|
setPopupVisibleOverride(visible) {
|
||||||
return apiForward('popupSetVisible', {visible});
|
return apiForward('popupSetVisibleOverride', {visible});
|
||||||
}
|
}
|
||||||
|
|
||||||
setSpinnerVisible(visible) {
|
setSpinnerVisible(visible) {
|
||||||
|
Loading…
Reference in New Issue
Block a user