Fixes issue with unable to open second dialog on wrong room key entered. Still tests to come. Handle dialog action after the dialog is closed, otherwise the event for wrong key can come before the dialog is closed and will not be open again.
This commit is contained in:
parent
b35e8aaf93
commit
a55e3f5d9d
7
app.js
7
app.js
|
@ -855,6 +855,10 @@ $(document).bind('passwordrequired.muc', function (event, jid) {
|
|||
'<input id="lockKey" type="text" placeholder="password" autofocus>',
|
||||
true,
|
||||
"Ok",
|
||||
function (e, v, m, f) {},
|
||||
function (event) {
|
||||
document.getElementById('lockKey').focus();
|
||||
},
|
||||
function (e, v, m, f) {
|
||||
if (v) {
|
||||
var lockKey = document.getElementById('lockKey');
|
||||
|
@ -863,9 +867,6 @@ $(document).bind('passwordrequired.muc', function (event, jid) {
|
|||
connection.emuc.doJoin(jid, lockKey.value);
|
||||
}
|
||||
}
|
||||
},
|
||||
function (event) {
|
||||
document.getElementById('lockKey').focus();
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
|
@ -24,8 +24,10 @@ var messageHandler = (function(my) {
|
|||
* @param leftButton the fist button's text
|
||||
* @param submitFunction function to be called on submit
|
||||
* @param loadedFunction function to be called after the prompt is fully loaded
|
||||
* @param closeFunction function to be called after the prompt is closed
|
||||
*/
|
||||
my.openTwoButtonDialog = function(titleString, msgString, persistent, leftButton, submitFunction, loadedFunction) {
|
||||
my.openTwoButtonDialog = function(titleString, msgString, persistent, leftButton,
|
||||
submitFunction, loadedFunction, closeFunction) {
|
||||
var buttons = {};
|
||||
buttons[leftButton] = true;
|
||||
buttons.Cancel = false;
|
||||
|
@ -35,7 +37,8 @@ var messageHandler = (function(my) {
|
|||
buttons: buttons,
|
||||
defaultButton: 1,
|
||||
loaded: loadedFunction,
|
||||
submit: submitFunction
|
||||
submit: submitFunction,
|
||||
close: closeFunction
|
||||
});
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue