Bug 1617449 - Make the "Remove Account" dialog in-content. r=mkmelin
This commit is contained in:
Родитель
1df3128698
Коммит
60b9c24fe0
|
@ -28,6 +28,7 @@
|
|||
/* import-globals-from accountUtils.js */
|
||||
/* import-globals-from am-prefs.js */
|
||||
/* import-globals-from amUtils.js */
|
||||
/* globals gSubDialog */
|
||||
|
||||
var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
var { BrowserUtils } = ChromeUtils.import(
|
||||
|
@ -918,32 +919,34 @@ function onRemoveAccount(event) {
|
|||
result: false,
|
||||
};
|
||||
|
||||
window.docShell.rootTreeItem.domWindow.openDialog(
|
||||
let onCloseDialog = function() {
|
||||
// If result is true, the account was removed.
|
||||
if (!removeArgs.result) {
|
||||
return;
|
||||
}
|
||||
|
||||
// clear cached data out of the account array
|
||||
currentAccount = currentPageId = null;
|
||||
if (serverId in accountArray) {
|
||||
delete accountArray[serverId];
|
||||
}
|
||||
|
||||
if (serverIndex >= 0 && serverIndex < serverList.length) {
|
||||
selectServer(serverList[serverIndex], null);
|
||||
}
|
||||
|
||||
// Either the default account was deleted so there is a new one
|
||||
// or the default account was not changed. Either way, there is
|
||||
// no need to unmark the old one.
|
||||
markDefaultServer(MailServices.accounts.defaultAccount, null);
|
||||
};
|
||||
|
||||
gSubDialog.open(
|
||||
"chrome://messenger/content/removeAccount.xhtml",
|
||||
"removeAccount",
|
||||
"chrome,titlebar,modal,centerscreen,resizable=no",
|
||||
removeArgs
|
||||
"resizable=no",
|
||||
removeArgs,
|
||||
onCloseDialog
|
||||
);
|
||||
|
||||
// If result is true, the account was removed.
|
||||
if (!removeArgs.result) {
|
||||
return;
|
||||
}
|
||||
|
||||
// clear cached data out of the account array
|
||||
currentAccount = currentPageId = null;
|
||||
if (serverId in accountArray) {
|
||||
delete accountArray[serverId];
|
||||
}
|
||||
|
||||
if (serverIndex >= 0 && serverIndex < serverList.length) {
|
||||
selectServer(serverList[serverIndex], null);
|
||||
}
|
||||
|
||||
// Either the default account was deleted so there is a new one
|
||||
// or the default account was not changed. Either way, there is
|
||||
// no need to unmark the old one.
|
||||
markDefaultServer(MailServices.accounts.defaultAccount, null);
|
||||
}
|
||||
|
||||
function saveAccount(accountValues, account) {
|
||||
|
|
|
@ -83,6 +83,7 @@ function openLocalDirectory() {
|
|||
}
|
||||
|
||||
function showInfo() {
|
||||
let removeAccountBox = document.getElementById("removeAccountBox");
|
||||
let descs = document.querySelectorAll("vbox.indent");
|
||||
for (let desc of descs) {
|
||||
desc.collapsed = false;
|
||||
|
@ -97,7 +98,7 @@ function showInfo() {
|
|||
document.getElementById("localAccount").collapsed = false;
|
||||
}
|
||||
|
||||
window.sizeToContent();
|
||||
window.resizeBy(0, removeAccountBox.getBoundingClientRect().height);
|
||||
gDialog.getButton("disclosure").disabled = true;
|
||||
gDialog.getButton("disclosure").blur();
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@
|
|||
accesskey="&removeData.accesskey;"
|
||||
accesskeyChat="&removeDataChat.accesskey;"
|
||||
oncommand="enableRemove();"/>
|
||||
<vbox class="indent" collapsed="true">
|
||||
<vbox id="removeAccountBox" class="indent" collapsed="true">
|
||||
<description id="localAccount" collapsed="true">
|
||||
&removeDataLocalAccount.desc;
|
||||
</description>
|
||||
|
|
Загрузка…
Ссылка в новой задаче