зеркало из https://github.com/mozilla/gecko-dev.git
Added ability to register OnOK handlers. r=hangas
This commit is contained in:
Родитель
5b5d193f2a
Коммит
9a15df736b
|
@ -21,6 +21,7 @@
|
|||
*/
|
||||
|
||||
var editCard;
|
||||
var gOnSaveListeners = new Array;
|
||||
|
||||
function OnLoadNewCard()
|
||||
{
|
||||
|
@ -90,6 +91,18 @@ function OnLoadEditCard()
|
|||
top.window.title = editCard.titlePrefix + editCard.card.displayName;
|
||||
}
|
||||
|
||||
function RegisterSaveListener(func)
|
||||
{
|
||||
var length = gOnSaveListeners.length;
|
||||
gOnSaveListeners[length] = func;
|
||||
}
|
||||
|
||||
function CallSaveListeners()
|
||||
{
|
||||
for ( var i = 0; i < gOnSaveListeners.length; i++ )
|
||||
gOnSaveListeners[i]();
|
||||
}
|
||||
|
||||
function InitEditCard()
|
||||
{
|
||||
// create editCard object that contains global variables for editCard.js
|
||||
|
@ -268,6 +281,7 @@ function SetCardValues(cardproperty, doc)
|
|||
cardproperty.custom4 = doc.getElementById('Custom4').value;
|
||||
cardproperty.notes = doc.getElementById('Notes').value;
|
||||
}
|
||||
CallSaveListeners();
|
||||
}
|
||||
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче