Merge pull request #2984 from ONLYOFFICE/fix/bug-67159

Fix/bug 67159
This commit is contained in:
Julia Radzhabova
2024-05-08 16:22:41 +03:00
committed by GitHub
2 changed files with 15 additions and 9 deletions

View File

@ -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);

View File

@ -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());