[DE] Refactoring hyperlinks
This commit is contained in:
parent
d5444d9c4d
commit
29212eadfe
|
@ -302,7 +302,8 @@ define([
|
||||||
|
|
||||||
getSettings: function () {
|
getSettings: function () {
|
||||||
var me = this,
|
var me = this,
|
||||||
props = new Asc.CHyperlinkProperty();
|
props = new Asc.CHyperlinkProperty(),
|
||||||
|
display = '';
|
||||||
|
|
||||||
if (this.linkType == c_oHyperlinkType.WebLink) {
|
if (this.linkType == c_oHyperlinkType.WebLink) {
|
||||||
var url = $.trim(me.inputUrl.getValue());
|
var url = $.trim(me.inputUrl.getValue());
|
||||||
|
@ -313,18 +314,20 @@ define([
|
||||||
url = url.replace(new RegExp("%20",'g')," ");
|
url = url.replace(new RegExp("%20",'g')," ");
|
||||||
props.put_Value(url);
|
props.put_Value(url);
|
||||||
props.put_Bookmark(null);
|
props.put_Bookmark(null);
|
||||||
|
display = url;
|
||||||
} else {
|
} else {
|
||||||
var rec = this.internalList.getSelectedRec();
|
var rec = this.internalList.getSelectedRec();
|
||||||
if (rec.length>0) {
|
if (rec.length>0) {
|
||||||
props.put_Bookmark(rec[0].get('name'));
|
props.put_Bookmark(rec[0].get('name'));
|
||||||
if (rec[0].get('index')==0)
|
if (rec[0].get('index')==0)
|
||||||
props.put_TopOfDocument();
|
props.put_TopOfDocument();
|
||||||
|
display = rec[0].get('name');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!me.inputDisplay.isDisabled() && ( this.isTextChanged || _.isEmpty(me.inputDisplay.getValue()))) {
|
if (!me.inputDisplay.isDisabled() && ( this.isTextChanged || _.isEmpty(me.inputDisplay.getValue()))) {
|
||||||
if (_.isEmpty(me.inputDisplay.getValue()))
|
if (_.isEmpty(me.inputDisplay.getValue()))
|
||||||
me.inputDisplay.setValue(url);
|
me.inputDisplay.setValue(display);
|
||||||
props.put_Text(me.inputDisplay.getValue());
|
props.put_Text(me.inputDisplay.getValue());
|
||||||
} else {
|
} else {
|
||||||
props.put_Text(null);
|
props.put_Text(null);
|
||||||
|
|
Loading…
Reference in a new issue