Bug 953624 - focus the connect/disconnect buttons automatically in the account manager. r=florian

This commit is contained in:
Romain Bezut 2009-08-02 23:42:23 +02:00
Родитель e3cfe7f3a0
Коммит 15976b5412
3 изменённых файлов: 17 добавлений и 1 удалений

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

@ -319,6 +319,15 @@
</body> </body>
</method> </method>
<method name="setButtonFocus">
<body>
<![CDATA[
let focusElt = (this._account.disconnected) ? "connect" : "disconnect";
document.getAnonymousElementByAttribute(this, "anonid", focusElt).focus();
]]>
</body>
</method>
<property name="autoLogin"> <property name="autoLogin">
<getter> <getter>
<![CDATA[ <![CDATA[

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

@ -155,6 +155,12 @@ var gAccountManager = {
this.accountList.selectedItem = document.getElementById(aAccountId); this.accountList.selectedItem = document.getElementById(aAccountId);
this.accountList.ensureSelectedElementIsVisible(); this.accountList.ensureSelectedElementIsVisible();
}, },
onAccountSelect: function am_onAccountSelect() {
// Horrible hack here too, see Bug 177
setTimeout(function(aThis) {
aThis.accountList.selectedItem.setButtonFocus();
}, 0, this);
},
getAccounts: function am_getAccounts() { getAccounts: function am_getAccounts() {
var pcs = Components.classes["@instantbird.org/purple/core;1"] var pcs = Components.classes["@instantbird.org/purple/core;1"]

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

@ -69,7 +69,8 @@
</keyset> </keyset>
<notificationbox id="accountsNotificationBox" flex="1"> <notificationbox id="accountsNotificationBox" flex="1">
<richlistbox id="accountlist" flex="1" ondblclick="gAccountManager.new()"/> <richlistbox id="accountlist" flex="1" ondblclick="gAccountManager.new()"
onselect="gAccountManager.onAccountSelect();"/>
</notificationbox> </notificationbox>
<hbox id="bottombuttons"> <hbox id="bottombuttons">
<button id="newaccount" oncommand="gAccountManager.new()" <button id="newaccount" oncommand="gAccountManager.new()"