Bug 867200 - Move the account info text up to the top of the sync flyout. r=ally

This commit is contained in:
Jim Mathies 2013-05-07 15:55:50 -05:00
parent e9e3db67dd
commit 23735a2bd5
2 changed files with 12 additions and 3 deletions

View File

@ -402,6 +402,7 @@
<flyoutpanel id="sync-flyoutpanel" headertext="&syncHeader.title;">
<description>&sync.setup.description;</description>
<description id="sync-accountinfo" collapsed="true"></description>
<description id="sync-lastsync" collapsed="true"></description>
<description id="sync-errordescription" collapsed="true"></description>
<setting id="sync-connect" type="control" collapsed="true">

View File

@ -420,7 +420,7 @@ let Sync = {
});
let settingids = ["device", "connect", "connected", "disconnect", "lastsync", "pairdevice",
"errordescription"];
"errordescription", "accountinfo"];
settingids.forEach(function(id) {
elements[id] = document.getElementById("sync-" + id);
});
@ -440,6 +440,7 @@ let Sync = {
let disconnect = this._elements.disconnect;
let lastsync = this._elements.lastsync;
let pairdevice = this._elements.pairdevice;
let accountinfo = this._elements.accountinfo;
// This gets updated when an error occurs
this._elements.errordescription.collapsed = true;
@ -460,9 +461,15 @@ let Sync = {
device.value = Weave.Service.clientsEngine.localName || "";
}
// Account information header
accountinfo.collapsed = true;
try {
let accountStr = this._bundle.formatStringFromName("account.label", [Weave.Service.identity.account], 1);
disconnect.setAttribute("title", accountStr);
let account = Weave.Service.identity.account;
if (account != null && isConfigured) {
let accountStr = this._bundle.formatStringFromName("account.label", [account], 1);
accountinfo.textContent = accountStr;
accountinfo.collapsed = false;
}
} catch (ex) {}
// If we're already locked, a sync is in progress..
@ -508,6 +515,7 @@ let Sync = {
this._updateUI();
let errormsg = this._elements.errordescription;
let accountinfo = this._elements.accountinfo;
// Show what went wrong with login if necessary
if (aTopic == "weave:ui:login:error") {