Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function handleFontChosen() {
if (lastFontSelected) {
_insertFontCompletionAtCursor(lastFontSelected, editor, cursor);
}
$(webfont).off("ewfFontChosen");
}
var dlg = Dialogs.showModalDialogUsingTemplate(ewfBrowseDialogTemplate);
dlg.done(function (id) {
if (id === Dialogs.DIALOG_BTN_OK) {
handleFontChosen();
}
editor.focus();
});
webfont.renderPicker($('.edge-web-fonts-browse-dialog.instance'));
$(webfont).on("ewfFontChosen", function () {
dlg.close();
handleFontChosen();
editor.focus();
});
}