From: unknown Date: Wed, 6 Aug 2008 12:21:56 +0000 (+0200) Subject: Fixed a focus bug using the other test site field X-Git-Url: https://git.jkkn.net/?a=commitdiff_plain;h=26a3a1f230f79f4af98dce6b9e3b6de12ae37970;p=tv2developer Fixed a focus bug using the other test site field --- diff --git a/content/quickbox.js b/content/quickbox.js index 2c4164b..1a57e20 100644 --- a/content/quickbox.js +++ b/content/quickbox.js @@ -84,15 +84,17 @@ var TV2DeveloperQuickBox = { }, /* Change action manually */ - setManuel: function(target) { + setManuel: function(target, doReturnFocus) { + if (typeof doReturnFocus == 'undefined') doReturnFocus = true; var action = document.getElementById('action').selectedItem.id; var makeSiteURL = this._shouldMakeURL(action); var environment = document.getElementById('environment').selectedItem; if (target.id == 'environment') { document.getElementById('testname').disabled = (target.selectedItem.id != 'othertest'); - if (!this._autoChange) { + if (!this._autoChange && (target.selectedItem.id == 'othertest')) { document.getElementById('testname').select(); document.getElementById('testname').focus(); + doReturnFocus = false; } } if (target.id == 'action') { @@ -110,7 +112,9 @@ var TV2DeveloperQuickBox = { document.getElementById('othertest'); } this.updateQuickbox(true); - document.getElementById('shorturl').focus(); + if (doReturnFocus) { + document.getElementById('shorturl').focus(); + } } }, diff --git a/content/quickbox.xul b/content/quickbox.xul index 5309f4d..9f30864 100644 --- a/content/quickbox.xul +++ b/content/quickbox.xul @@ -42,8 +42,8 @@ + onclick="TV2DeveloperQuickBox.setManuel(this, false)" + oninput="TV2DeveloperQuickBox.setManuel(this, false)"/>