This commit is contained in:
Felipe Gomes 2015-10-13 20:33:35 -03:00
Родитель 62ea4c17d5
Коммит 3ad5426b56
1 изменённых файлов: 19 добавлений и 3 удалений

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

@ -31,6 +31,10 @@
var Cc = Components.classes;
var Ci = Components.interfaces;
var Cr = Components.results;
var Cu = Components.utils;
Cu.import("resource://gre/modules/SharedPromptUtils.jsm");
var dialog = {
//////////////////////////////////////////////////////////////////////////////
@ -41,6 +45,7 @@ var dialog = {
_itemChoose: null,
_okButton: null,
_windowCtxt: null,
_buttonDisabled: true,
//////////////////////////////////////////////////////////////////////////////
//// Methods
@ -58,8 +63,6 @@ var dialog = {
this._itemChoose = document.getElementById("item-choose");
this._okButton = document.documentElement.getButton("accept");
this.updateOKButton();
var description = {
image: document.getElementById("description-image"),
text: document.getElementById("description-text")
@ -85,6 +88,18 @@ var dialog = {
// UI is ready, lets populate our list
this.populateList();
this._delayHelper = new EnableDelayHelper({
disableDialog: () => {
this._buttonDisabled = true;
this.updateOKButton();
},
enableDialog: () => {
this._buttonDisabled = false;
this.updateOKButton();
},
focusTarget: window
});
},
/**
@ -222,7 +237,8 @@ var dialog = {
*/
updateOKButton: function updateOKButton()
{
this._okButton.disabled = this._itemChoose.selected;
this._okButton.disabled = this._itemChoose.selected ||
this._buttonDisabled;
},
/**