diff --git a/apps/presentationeditor/main/app/controller/DocumentHolder.js b/apps/presentationeditor/main/app/controller/DocumentHolder.js index 53f60049a0..18284af7e9 100644 --- a/apps/presentationeditor/main/app/controller/DocumentHolder.js +++ b/apps/presentationeditor/main/app/controller/DocumentHolder.js @@ -75,6 +75,11 @@ var c_paragraphSpecial = { HANGING: 2 }; +var c_oHyperlinkType = { + InternalLink:0, + WebLink: 1 +}; + define([ 'core', 'presentationeditor/main/app/view/DocumentHolder' @@ -1136,7 +1141,7 @@ define([ } }, - onDialogAddHyperlink: function() { + onDialogAddHyperlink: function(isButton) { var win, props, text; var me = this; if (me.api && me.mode.isEdit && !me._isDisabled && !PE.getController('LeftMenu').leftMenu.menuFile.isVisible()){ @@ -1165,11 +1170,16 @@ define([ api: me.api, appOptions: me.mode, handler: handlerDlg, + type: isButton===true ? c_oHyperlinkType.InternalLink : undefined, slides: _arr }); - props = new Asc.CHyperlinkProperty(); - props.put_Text(text); + if (isButton && (isButton instanceof Asc.CHyperlinkProperty)) + props = isButton; + else { + props = new Asc.CHyperlinkProperty() + props.put_Text(text); + } win.show(); win.setSettings(props); diff --git a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js index 456f2cdae8..184837611d 100644 --- a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js @@ -41,11 +41,6 @@ if (Common === undefined) var Common = {}; -var c_oHyperlinkType = { - InternalLink:0, - WebLink: 1 -}; - define([ 'common/main/lib/util/utils', 'common/main/lib/component/InputField', @@ -99,6 +94,7 @@ define([ this.options.tpl = _.template(this.template)(this.options); this.slides = this.options.slides; this.api = this.options.api; + this.type = options.type; this.urlType = AscCommon.c_oAscUrlType.Invalid; this.appOptions = this.options.appOptions; @@ -203,7 +199,7 @@ define([ if (props) { var me = this; - var type = me.parseUrl(props.get_Value()); + var type = (me.type!==undefined) ? me.type : me.parseUrl(props.get_Value()); (type == c_oHyperlinkType.WebLink) ? me.btnExternal.toggle(true) : me.btnInternal.toggle(true); me.ShowHideElem(type, props.get_Value());