diff --git a/apps/common/main/lib/view/PdfSignDialog.js b/apps/common/main/lib/view/PdfSignDialog.js index e3daf7cd31..1d8f92d290 100644 --- a/apps/common/main/lib/view/PdfSignDialog.js +++ b/apps/common/main/lib/view/PdfSignDialog.js @@ -357,6 +357,13 @@ define([], function () { 'use strict'; me.api.asc_unregisterCallback('asc_CanRedoSignature', onCanRedoChanged); Common.NotificationCenter.off('storage:image-insert', insertImageFromStorage); }); + + const $window = this.getChild(); + $window.find('.dlg-btn').on('click', e => { + if ( me.options.handler ) + me.options.handler.call(me, event.currentTarget.attributes['result'].value); + me.close(); + }); }, updateThemeColors: function() { diff --git a/apps/documenteditor/main/app/controller/DocumentHolderExt.js b/apps/documenteditor/main/app/controller/DocumentHolderExt.js index 9085621d67..24a6e258cb 100644 --- a/apps/documenteditor/main/app/controller/DocumentHolderExt.js +++ b/apps/documenteditor/main/app/controller/DocumentHolderExt.js @@ -1832,24 +1832,18 @@ define([], function () { return; } if (me.mode.canSaveToFile) { - // if (_.isUndefined(me.fontStore)) { - // me.fontStore = new Common.Collections.Fonts(); - // var fonts = me.getApplication().getController('Toolbar').getView('Toolbar').cmbFontName.store.toJSON(); - // var arr = []; - // _.each(fonts, function(font, index){ - // if (!font.cloneid) { - // arr.push(_.clone(font)); - // } - // }); - // me.fontStore.add(arr); - // } + if (!me.fontStore) { + me.fontStore = new Common.Collections.Fonts(); + const fonts = me.getApplication().getController('Toolbar').getView('Toolbar').cmbFontName.store.toJSON(); + me.fontStore.add(fonts.filter(font => !font.cloneid)); + } var signProps = obj.asc_getSignatureProps(me.api); var win = (new Common.Views.PdfSignDialog({ props: signProps, api: me.api, disableNetworkFunctionality: me.mode.disableNetworkFunctionality, storage: me.mode.canRequestInsertImage || me.mode.fileChoiceUrl && me.mode.fileChoiceUrl.indexOf("{documentType}")>-1, - fontStore: new Common.Collections.Fonts(), + fontStore: me.fontStore, handler: function(result, value) { if (result == 'ok') { me.api.asc_SetSignatureProps(signProps.getResult());