[SSE] Fix Bug 25565

This commit is contained in:
Julia Radzhabova 2020-03-26 17:42:14 +03:00
parent fa6bafaec4
commit fbf1e817d7
2 changed files with 44 additions and 2 deletions

View file

@ -90,7 +90,10 @@ define([
'<div class="input-row">',
'<label>' + this.strRange + '</label>',
'</div>',
'<div id="id-dlg-hyperlink-range" class="input-row" style="margin-bottom: 5px;"></div>',
'<div class="input-row" style="margin-bottom: 5px;display: flex;">',
'<div id="id-dlg-hyperlink-range" style="flex-grow: 1;"></div>',
'<button type="button" class="btn btn-text-default" id="id-dlg-hyperlink-btn-data" style="min-width: 100px;width: auto; margin-left: 10px;">' + this.textSelectData + '</button>',
'</div>',
'</div>',
'<div class="input-row">',
'<label>' + this.strDisplay + '</label>',
@ -106,6 +109,7 @@ define([
this.options.tpl = _.template(this.template)(this.options);
this.api = this.options.api;
this.appOptions = options.appOptions;
this.dataRangeValid = '';
Common.UI.Window.prototype.initialize.call(this, this.options);
},
@ -203,6 +207,11 @@ define([
});
me.internalList.on('item:select', _.bind(this.onSelectItem, this));
me.btnSelectData = new Common.UI.Button({
el: $('#id-dlg-hyperlink-btn-data')
});
me.btnSelectData.on('click', _.bind(me.onSelectData, me));
if (me.appOptions && me.appOptions.canMakeActionLink) {
var inputCopy = new Common.UI.InputField({
el : $('#id-dlg-clip-copy'),
@ -275,10 +284,12 @@ define([
if (type == Asc.c_oAscHyperlinkType.RangeLink) {
if (settings.props.asc_getSheet()) {
this.inputRange.setValue(settings.props.asc_getRange());
this.dataRangeValid = this.inputRange.getValue();
this.focusedInput = this.inputRange.cmpEl.find('input');
defrange = settings.props.asc_getSheet() + '!' + settings.props.asc_getRange();
} else {// named range
this.inputRange.setDisabled(true);
this.btnSelectData.setDisabled(true);
defrange = settings.props.asc_getLocation();
}
} else {
@ -470,6 +481,7 @@ define([
onSelectItem: function(picker, item, record, e){
this.btnOk.setDisabled(record.get('level')==0 || record.get('type')==0 && $.trim(this.inputRange.getValue())=='');
this.inputRange.setDisabled(record.get('type')==1 || record.get('level')==0);
this.btnSelectData.setDisabled(record.get('type')==1 || record.get('level')==0);
if (this.isAutoUpdate) {
var list = record.get('level') ? record.get('name') : '';
if (record.get('type')==1) {
@ -502,6 +514,34 @@ define([
}
},
onSelectData: function() {
var me = this;
if (me.api) {
var handlerDlg = function(dlg, result) {
if (result == 'ok') {
me.dataRangeValid = dlg.getSettings();
me.inputRange.setValue(me.dataRangeValid);
me.inputRange.checkValidate();
}
};
var win = new SSE.Views.CellRangeDialog({
handler: handlerDlg
}).on('close', function() {
me.show();
});
var xy = me.$window.offset();
me.hide();
win.show(xy.left + 160, xy.top + 125);
win.setSettings({
api : me.api,
range : (!_.isEmpty(me.inputRange.getValue()) && (me.inputRange.checkValidate()==true)) ? me.inputRange.getValue() : me.dataRangeValid,
type : Asc.c_oAscSelectionDialogType.FormatTable
});
}
},
textTitle: 'Hyperlink Settings',
textInternalLink: 'Place in Document',
textExternalLink: 'Web Link',
@ -520,6 +560,7 @@ define([
textSheets: 'Sheets',
textNames: 'Defined names',
textGetLink: 'Get Link',
textCopy: 'Copy'
textCopy: 'Copy',
textSelectData: 'Select Data'
}, SSE.Views.HyperlinkSettingsDialog || {}))
});

View file

@ -1773,6 +1773,7 @@
"SSE.Views.HyperlinkSettingsDialog.textNames": "Defined names",
"SSE.Views.HyperlinkSettingsDialog.textGetLink": "Get Link",
"SSE.Views.HyperlinkSettingsDialog.textCopy": "Copy",
"SSE.Views.HyperlinkSettingsDialog.textSelectData": "Select Data",
"SSE.Views.ImageSettings.textAdvanced": "Show advanced settings",
"SSE.Views.ImageSettings.textCrop": "Crop",
"SSE.Views.ImageSettings.textCropFill": "Fill",