mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-25 22:01:30 +00:00
282872 - downloads dialog OK must be clicked twice to start download
This commit is contained in:
parent
05bc50ffc6
commit
5a79023d0a
@ -202,8 +202,8 @@ function commonDialogOnLoad()
|
||||
|
||||
setTimeout(commonDialogReenableButtons, delayInterval);
|
||||
|
||||
document.documentElement.addEventListener("blur", commonDialogBlur, false);
|
||||
document.documentElement.addEventListener("focus", commonDialogFocus, false);
|
||||
addEventListener("blur", commonDialogBlur, false);
|
||||
addEventListener("focus", commonDialogFocus, false);
|
||||
}
|
||||
|
||||
getAttention();
|
||||
@ -212,16 +212,20 @@ function commonDialogOnLoad()
|
||||
var gDelayExpired = false;
|
||||
var gBlurred = false;
|
||||
|
||||
function commonDialogBlur()
|
||||
function commonDialogBlur(aEvent)
|
||||
{
|
||||
if (aEvent.target != document)
|
||||
return;
|
||||
gBlurred = true;
|
||||
document.documentElement.getButton("accept").disabled = true;
|
||||
document.documentElement.getButton("extra1").disabled = true;
|
||||
document.documentElement.getButton("extra2").disabled = true;
|
||||
}
|
||||
|
||||
function commonDialogFocus()
|
||||
function commonDialogFocus(aEvent)
|
||||
{
|
||||
if (aEvent.target != document)
|
||||
return;
|
||||
gBlurred = false;
|
||||
// When refocusing the window, don't enable the buttons unless the countdown
|
||||
// delay has expired.
|
||||
|
@ -51,7 +51,7 @@
|
||||
<dialog id="unknownContentType"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
onload="dialog.initDialog();" onunload="if (dialog) dialog.onCancel();"
|
||||
onblur="dialog.onBlur();" onfocus="dialog.onFocus();"
|
||||
onblur="dialog.onBlur(event);" onfocus="dialog.onFocus(event);"
|
||||
style="width: 34em;"
|
||||
screenX="" screenY=""
|
||||
persist="screenX screenY"
|
||||
|
@ -517,12 +517,16 @@ nsUnknownContentTypeDialog.prototype = {
|
||||
|
||||
_blurred: false,
|
||||
_delayExpired: false,
|
||||
onBlur: function() {
|
||||
onBlur: function(aEvent) {
|
||||
if (aEvent.target != this.mDialog.document)
|
||||
return;
|
||||
this._blurred = true;
|
||||
this.mDialog.document.documentElement.getButton("accept").disabled = true;
|
||||
},
|
||||
|
||||
onFocus: function() {
|
||||
onFocus: function(aEvent) {
|
||||
if (aEvent.target != this.mDialog.document)
|
||||
return;
|
||||
this._blurred = false;
|
||||
if (this._delayExpired) {
|
||||
var script = "document.documentElement.getButton('accept').disabled = false";
|
||||
|
Loading…
Reference in New Issue
Block a user