From e826d8a8e192f23bf83ba77bc42d1ccccfe6a11a Mon Sep 17 00:00:00 2001 From: Julia Radzhabova Date: Tue, 17 Mar 2020 10:42:03 +0300 Subject: [PATCH] Bug 44821: save type of the last added hyperlink --- .../main/app/view/HyperlinkSettingsDialog.js | 3 ++- .../main/app/view/HyperlinkSettingsDialog.js | 5 +++-- .../main/app/view/HyperlinkSettingsDialog.js | 7 ++++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js b/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js index 7717c2663..ea5211401 100644 --- a/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/documenteditor/main/app/view/HyperlinkSettingsDialog.js @@ -308,7 +308,7 @@ define([ var me = this; var bookmark = props.get_Bookmark(), - type = (bookmark === null || bookmark=='') ? c_oHyperlinkType.WebLink : c_oHyperlinkType.InternalLink; + type = (bookmark === null || bookmark=='') ? ((props.get_Value() || !Common.Utils.InternalSettings.get("de-settings-link-type")) ? c_oHyperlinkType.WebLink : c_oHyperlinkType.InternalLink) : c_oHyperlinkType.InternalLink; (type == c_oHyperlinkType.WebLink) ? me.btnExternal.toggle(true) : me.btnInternal.toggle(true); me.ShowHideElem(type); @@ -426,6 +426,7 @@ define([ this.inputDisplay.cmpEl.find('input').focus(); return; } + (!this._originalProps.get_Bookmark() && !this._originalProps.get_Value()) && Common.Utils.InternalSettings.set("de-settings-link-type", this.btnInternal.isActive()); // save last added hyperlink } this.options.handler.call(this, this, state); diff --git a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js index b4c32dfb6..1a04a0cea 100644 --- a/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/presentationeditor/main/app/view/HyperlinkSettingsDialog.js @@ -210,6 +210,7 @@ define([ me.inputUrl.cmpEl.find('input').focus(); },50); } + me._originalProps = props; } }, @@ -275,8 +276,8 @@ define([ this.inputDisplay.cmpEl.find('input').focus(); return; } + !this._originalProps.get_Value() && Common.Utils.InternalSettings.set("pe-settings-link-type", this.btnInternal.isActive()); } - this.options.handler.call(this, this, state); } @@ -390,7 +391,7 @@ define([ parseUrl: function(url) { if (url===null || url===undefined || url=='' ) - return c_oHyperlinkType.WebLink; + return Common.Utils.InternalSettings.get("pe-settings-link-type") ? c_oHyperlinkType.InternalLink : c_oHyperlinkType.WebLink; var indAction = url.indexOf("ppaction://hlink"); if (0 == indAction) diff --git a/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js b/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js index 5b3817b2e..4cd64730e 100644 --- a/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js +++ b/apps/spreadsheeteditor/main/app/view/HyperlinkSettingsDialog.js @@ -220,16 +220,16 @@ define([ var me = this; me.settings = settings; - var type = (settings.props) ? settings.props.asc_getType() : Asc.c_oAscHyperlinkType.WebLink; + var type = (settings.props) ? settings.props.asc_getType() : (Common.Utils.InternalSettings.get("sse-settings-link-type") ? Asc.c_oAscHyperlinkType.RangeLink : Asc.c_oAscHyperlinkType.WebLink); (type == Asc.c_oAscHyperlinkType.WebLink) ? me.btnExternal.toggle(true) : me.btnInternal.toggle(true); me.ShowHideElem(type, settings.props); me.btnInternal.setDisabled(!settings.allowInternal && (type == Asc.c_oAscHyperlinkType.WebLink)); me.btnExternal.setDisabled(!settings.allowInternal && (type == Asc.c_oAscHyperlinkType.RangeLink)); var defrange = ''; - if (!settings.props) { + if (!settings.props) { // add link this.inputDisplay.setValue(settings.isLock ? this.textDefault : settings.text); - this.focusedInput = this.inputUrl.cmpEl.find('input'); + this.focusedInput = (type == Asc.c_oAscHyperlinkType.WebLink) ? this.inputUrl.cmpEl.find('input') : this.inputRange.cmpEl.find('input'); } else { if (type == Asc.c_oAscHyperlinkType.RangeLink) { if (settings.props.asc_getSheet()) { @@ -324,6 +324,7 @@ define([ this.inputDisplay.cmpEl.find('input').focus(); return; } + !this.settings.props && Common.Utils.InternalSettings.set("sse-settings-link-type", this.btnInternal.isActive()); // save last added hyperlink } this.options.handler.call(this, this, state);