Merge pull request #207 from toasted-nutbread/popup-proxy-writing-mode

Add writingMode to PopupProxy* termsShow and kanjiShow
This commit is contained in:
Alex Yatskov 2019-09-12 19:48:22 -07:00 committed by GitHub
commit ec816e6767
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions

View File

@ -43,8 +43,8 @@ class PopupProxyHost {
hide: ({id}) => this.hide(id), hide: ({id}) => this.hide(id),
setVisible: ({id, visible}) => this.setVisible(id, visible), setVisible: ({id, visible}) => this.setVisible(id, visible),
containsPoint: ({id, point}) => this.containsPoint(id, point), containsPoint: ({id, point}) => this.containsPoint(id, point),
termsShow: ({id, elementRect, definitions, options, context}) => this.termsShow(id, elementRect, definitions, options, context), termsShow: ({id, elementRect, writingMode, definitions, options, context}) => this.termsShow(id, elementRect, writingMode, definitions, options, context),
kanjiShow: ({id, elementRect, definitions, options, context}) => this.kanjiShow(id, elementRect, definitions, options, context), kanjiShow: ({id, elementRect, writingMode, definitions, options, context}) => this.kanjiShow(id, elementRect, writingMode, definitions, options, context),
clearAutoPlayTimer: ({id}) => this.clearAutoPlayTimer(id) clearAutoPlayTimer: ({id}) => this.clearAutoPlayTimer(id)
}); });
} }
@ -113,16 +113,16 @@ class PopupProxyHost {
return await popup.containsPoint(point); return await popup.containsPoint(point);
} }
async termsShow(id, elementRect, definitions, options, context) { async termsShow(id, elementRect, writingMode, definitions, options, context) {
const popup = this.getPopup(id); const popup = this.getPopup(id);
elementRect = this.jsonRectToDOMRect(popup, elementRect); elementRect = this.jsonRectToDOMRect(popup, elementRect);
return await popup.termsShow(elementRect, definitions, options, context); return await popup.termsShow(elementRect, writingMode, definitions, options, context);
} }
async kanjiShow(id, elementRect, definitions, options, context) { async kanjiShow(id, elementRect, writingMode, definitions, options, context) {
const popup = this.getPopup(id); const popup = this.getPopup(id);
elementRect = this.jsonRectToDOMRect(popup, elementRect); elementRect = this.jsonRectToDOMRect(popup, elementRect);
return await popup.kanjiShow(elementRect, definitions, options, context); return await popup.kanjiShow(elementRect, writingMode, definitions, options, context);
} }
async clearAutoPlayTimer(id) { async clearAutoPlayTimer(id) {

View File

@ -76,16 +76,16 @@ class PopupProxy {
return await this.invokeHostApi('containsPoint', {id: this.id, point}); return await this.invokeHostApi('containsPoint', {id: this.id, point});
} }
async termsShow(elementRect, definitions, options, context) { async termsShow(elementRect, writingMode, definitions, options, context) {
const id = await this.getPopupId(); const id = await this.getPopupId();
elementRect = PopupProxy.DOMRectToJson(elementRect); elementRect = PopupProxy.DOMRectToJson(elementRect);
return await this.invokeHostApi('termsShow', {id, elementRect, definitions, options, context}); return await this.invokeHostApi('termsShow', {id, elementRect, writingMode, definitions, options, context});
} }
async kanjiShow(elementRect, definitions, options, context) { async kanjiShow(elementRect, writingMode, definitions, options, context) {
const id = await this.getPopupId(); const id = await this.getPopupId();
elementRect = PopupProxy.DOMRectToJson(elementRect); elementRect = PopupProxy.DOMRectToJson(elementRect);
return await this.invokeHostApi('kanjiShow', {id, elementRect, definitions, options, context}); return await this.invokeHostApi('kanjiShow', {id, elementRect, writingMode, definitions, options, context});
} }
async clearAutoPlayTimer() { async clearAutoPlayTimer() {