Issue where a dialog will not be display if you close and open another one real quick
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var i = 0; | |
function displayDialog() { | |
var url = "https://localhost:3000/test.html"; | |
Office.context.ui.displayDialogAsync(url,{height:20, width:30, displayInIframe:true}, | |
function (asyncResult) { | |
var dialog = asyncResult.value; // get the dialog | |
var error = asyncResult.error; | |
if(dialog == undefined && error.code > 0) { | |
// log the error | |
console.log(error.message); | |
} else { | |
// attache the events | |
dialog.addEventHandler(Office.EventType.DialogEventReceived, function (arg) { | |
// close this dialog, open the next | |
dialog.close(); | |
i++; | |
if(i<4) { | |
displayDialog(); | |
} | |
}); | |
dialog.addEventHandler(Office.EventType.DialogMessageReceived, function (arg) { | |
// close this dialog, open the next | |
dialog.close(); | |
i++; | |
if(i<4) { | |
displayDialog(); | |
} | |
}); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment