Bug 1209204 - allow the focus manager to select the appropriate control to focus after editing the computer name in Sync prefs. r=MattN

This commit is contained in:
Mark Hammond 2015-11-06 14:13:55 +11:00
Родитель 0614b39cb9
Коммит 65f4ae086d
1 изменённых файлов: 12 добавлений и 5 удалений

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

@ -164,8 +164,11 @@ var gSyncPane = {
document.getElementById("fxaSyncComputerName").blur();
},
_focusChangeDeviceNameButton: function() {
document.getElementById("fxaChangeDeviceName").focus();
_focusAfterComputerNameTextbox: function() {
// Focus the most appropriate element that's *not* the "computer name" box.
Services.focus.moveFocus(window,
document.getElementById("fxaSyncComputerName"),
Services.focus.MOVEFOCUS_FORWARD, 0);
},
_updateComputerNameValue: function(save) {
@ -227,17 +230,21 @@ var gSyncPane = {
this._focusComputerNameTextbox();
});
setEventListener("fxaCancelChangeDeviceName", "command", function () {
// We explicitly blur the textbox because of bug 1194032
// We explicitly blur the textbox because of bug 75324, then after
// changing the state of the buttons, force focus to whatever the focus
// manager thinks should be next (which on the mac, depends on an OSX
// keyboard access preference)
this._blurComputerNameTextbox();
this._toggleComputerNameControls(false);
this._updateComputerNameValue(false);
this._focusChangeDeviceNameButton();
this._focusAfterComputerNameTextbox();
});
setEventListener("fxaSaveChangeDeviceName", "command", function () {
// Work around bug 75324 - see above.
this._blurComputerNameTextbox();
this._toggleComputerNameControls(false);
this._updateComputerNameValue(true);
this._focusChangeDeviceNameButton();
this._focusAfterComputerNameTextbox();
});
setEventListener("unlinkDevice", "click", function () {
gSyncPane.startOver(true);