Backed out changeset 31d5ffaf0b16 (bug 1836633) for causing bc failures in browser_translations_panel_always_translate_language.js CLOSED TREE

This commit is contained in:
Cristian Tuns 2023-06-24 15:11:16 -04:00
Родитель 7b5c61c7e8
Коммит 829794ed69
4 изменённых файлов: 32 добавлений и 33 удалений

Просмотреть файл

@ -636,28 +636,4 @@
class="unified-extensions-context-menu-report-extension"
oncommand="gUnifiedExtensions.reportExtension(this.parentElement)" />
</menupopup>
<menupopup id="translations-panel-settings-menupopup">
<menuitem class="always-translate-language-menuitem"
data-l10n-id="translations-panel-settings-always-translate-unknown-language"
type="checkbox"
checked="false"
autocheck="false"
oncommand="TranslationsPanel.onAlwaysTranslateLanguage()"/>
<menuitem class="never-translate-language-menuitem"
data-l10n-id="translations-panel-settings-never-translate-unknown-language"
type="checkbox"
checked="false"
autocheck="false"
oncommand="TranslationsPanel.onNeverTranslateLanguage()"/>
<menuitem class="never-translate-site-menuitem"
data-l10n-id="translations-panel-settings-never-translate-site"
type="checkbox"
checked="false"
autocheck="false"
oncommand="TranslationsPanel.onNeverTranslateSite()"/>
<menuseparator/>
<menuitem data-l10n-id="translations-panel-settings-manage-languages"
oncommand="TranslationsPanel.openManageLanguages()"/>
</menupopup>
</popupset>

Просмотреть файл

@ -23,7 +23,32 @@
<toolbarbutton id="translations-panel-settings" class="panel-info-button"
data-l10n-id="translations-panel-settings-button"
closemenu="none"
oncommand="TranslationsPanel.openSettingsPopup(this)"/>
oncommand="TranslationsPanel.openSettingsPopup(this)">
<image class="translations-panel-gear-icon" />
<menupopup>
<menuitem class="always-translate-language-menuitem"
data-l10n-id="translations-panel-settings-always-translate-unknown-language"
type="checkbox"
checked="false"
autocheck="false"
oncommand="TranslationsPanel.onAlwaysTranslateLanguage()"/>
<menuitem class="never-translate-language-menuitem"
data-l10n-id="translations-panel-settings-never-translate-unknown-language"
type="checkbox"
checked="false"
autocheck="false"
oncommand="TranslationsPanel.onNeverTranslateLanguage()"/>
<menuitem class="never-translate-site-menuitem"
data-l10n-id="translations-panel-settings-never-translate-site"
type="checkbox"
checked="false"
autocheck="false"
oncommand="TranslationsPanel.onNeverTranslateSite()"/>
<menuseparator/>
<menuitem data-l10n-id="translations-panel-settings-manage-languages"
oncommand="TranslationsPanel.openManageLanguages()"/>
</menupopup>
</toolbarbutton>
</hbox>
<vbox class="translations-panel-content">

Просмотреть файл

@ -727,7 +727,7 @@ var TranslationsPanel = new (class {
*/
async #updateSettingsMenuSiteCheckboxStates() {
const { panel } = this.elements;
const neverTranslateSiteMenuItems = panel.ownerDocument.querySelectorAll(
const neverTranslateSiteMenuItems = panel.querySelectorAll(
".never-translate-site-menuitem"
);
const neverTranslateSite =
@ -747,10 +747,10 @@ var TranslationsPanel = new (class {
const { panel } = this.elements;
const alwaysTranslateMenuItems = panel.ownerDocument.querySelectorAll(
const alwaysTranslateMenuItems = panel.querySelectorAll(
".always-translate-language-menuitem"
);
const neverTranslateMenuItems = panel.ownerDocument.querySelectorAll(
const neverTranslateMenuItems = panel.querySelectorAll(
".never-translate-language-menuitem"
);
@ -956,10 +956,8 @@ var TranslationsPanel = new (class {
openSettingsPopup(button) {
this.#updateSettingsMenuLanguageCheckboxStates();
this.#updateSettingsMenuSiteCheckboxStates();
const popup = button.ownerDocument.getElementById(
"translations-panel-settings-menupopup"
);
popup.openPopup(button, "after_end");
const popup = button.querySelector("menupopup");
popup.openPopup(button);
}
/**

Просмотреть файл

@ -17,7 +17,7 @@
padding-bottom: 0;
}
#translations-panel-settings > image {
image.translations-panel-gear-icon {
/* Override the panel-info-button with a gear icon. */
list-style-image: url(chrome://global/skin/icons/settings.svg);
}