Skip to content

Commit 2bc52ea

Browse files
committed
remove translate button on pages..
...without text to translate
1 parent 9b4851a commit 2bc52ea

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

wfes-AddTranslationButtons.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,13 +279,21 @@
279279
createButton(allText);
280280
}
281281

282+
function pageLoad() {
283+
const PAGES = window.wfes.g.wfPages(); // load constants
284+
if (window.wfes.f.isPage(PAGES.PROFILE, PAGES.MANAGE, PAGES.SETTING, PAGES.HELP)) {
285+
removeButton();
286+
}
287+
}
288+
282289
function initWF() {
283290
window.addEventListener("WFESReviewPageNewLoaded", addTranslationButtonsNew);
284291
window.addEventListener("WFESReviewPageEditLoaded", addTranslationButtonsEdit);
285292
window.addEventListener("WFESReviewPagePhotoLoaded", addTranslationButtonsPhoto);
286293
window.addEventListener("WFESReviewDecisionSent", removeButton);
287294
window.addEventListener("WFESHomePageLoaded", addTranslationButtonsShowcase);
288295
window.addEventListener("WFESShowCaseClick", showCaseClick);
296+
window.addEventListener("WFESPageLoaded", pageLoad);
289297

290298
window.wfes.f.addCSS(myCSSId, myStyle);
291299
window.wfes.f.localGet(storageName, "Deepl").then(e => {

0 commit comments

Comments
 (0)