Bug 1187007 - Blur computer name textbox on cancel and save in sync preferences. r=markh

This commit is contained in:
Edouard Oger 2015-08-25 11:06:00 -04:00
Родитель 2a996238c2
Коммит 1a85753929
1 изменённых файлов: 13 добавлений и 0 удалений

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

@ -168,6 +168,14 @@ let gSyncPane = {
textbox.setSelectionRange(valLength, valLength);
},
_blurComputerNameTextbox: function() {
document.getElementById("fxaSyncComputerName").blur();
},
_focusChangeDeviceNameButton: function() {
document.getElementById("fxaChangeDeviceName").focus();
},
_updateComputerNameValue: function(save) {
let textbox = document.getElementById("fxaSyncComputerName");
if (save) {
@ -214,12 +222,17 @@ let gSyncPane = {
this._focusComputerNameTextbox();
});
setEventListener("fxaCancelChangeDeviceName", "command", function () {
// We explicitly blur the textbox because of bug 1194032
this._blurComputerNameTextbox();
this._toggleComputerNameControls(false);
this._updateComputerNameValue(false);
this._focusChangeDeviceNameButton();
});
setEventListener("fxaSaveChangeDeviceName", "command", function () {
this._blurComputerNameTextbox();
this._toggleComputerNameControls(false);
this._updateComputerNameValue(true);
this._focusChangeDeviceNameButton();
});
setEventListener("unlinkDevice", "click", function () {
gSyncPane.startOver(true);