[SSE] Fix internal links

This commit is contained in:
Julia Radzhabova 2020-03-16 13:30:51 +03:00
parent 94633cce20
commit e6c0127698
3 changed files with 24 additions and 22 deletions

View file

@ -513,9 +513,7 @@ define([
items = [];
while (++i < wc) {
if (!this.api.asc_isWorksheetHidden(i)) {
items.push(me.api.asc_getWorksheetName(i));
}
items.push({name: me.api.asc_getWorksheetName(i), hidden: me.api.asc_isWorksheetHidden(i)});
}
var handlerDlg = function(dlg, result) {

View file

@ -880,9 +880,7 @@ define([
items = [];
while (++i < wc) {
if (!this.api.asc_isWorksheetHidden(i)) {
items.push(me.api.asc_getWorksheetName(i));
}
items.push({name: me.api.asc_getWorksheetName(i), hidden: me.api.asc_isWorksheetHidden(i)});
}
var handlerDlg = function(dlg, result) {

View file

@ -64,7 +64,7 @@ define([
}, options || {});
this.template = [
'<div class="box" style="height: 290px;">',
'<div class="box" style="height: 313px;">',
'<div class="input-row" style="margin-bottom: 10px;">',
'<button type="button" class="btn btn-text-default auto" id="id-dlg-hyperlink-external" style="border-top-right-radius: 0;border-bottom-right-radius: 0;">', this.textExternalLink,'</button>',
'<button type="button" class="btn btn-text-default auto" id="id-dlg-hyperlink-internal" style="border-top-left-radius: 0;border-bottom-left-radius: 0;">', this.textInternalLink,'</button>',
@ -76,11 +76,14 @@ define([
'<div id="id-dlg-hyperlink-url" class="input-row" style="margin-bottom: 5px;"></div>',
'</div>',
'<div id="id-internal-link" class="hidden">',
'<div class="input-row">',
'<label>' + this.strLinkTo + '</label>',
'</div>',
'<div id="id-dlg-hyperlink-list" style="width:100%; height: 115px;border: 1px solid #cfcfcf;"></div>',
'<div class="input-row">',
'<label>' + this.strRange + '</label>',
'</div>',
'<div id="id-dlg-hyperlink-range" class="input-row" style="margin-bottom: 5px;"></div>',
'<div id="id-dlg-hyperlink-list" style="width:100%; height: 115px;border: 1px solid #cfcfcf;"></div>',
'</div>',
'<div class="input-row">',
'<label>' + this.strDisplay + '</label>',
@ -349,8 +352,8 @@ define([
hasSubItems: true
}));
for (var i=0; i<count; i++) {
arr.push(new Common.UI.TreeViewModel({
name : sheets[i],
!sheets[i].hidden && arr.push(new Common.UI.TreeViewModel({
name : sheets[i].name,
level: 1,
index: i+1,
type: 0, // sheet
@ -373,11 +376,13 @@ define([
prev_level = 0;
count = ranges.length;
for (var i=0; i<count; i++) {
var range = ranges[i];
var range = ranges[i],
scope = range.asc_getScope();
if (!range.asc_getIsHidden()) {
if (prev_level<1)
arr[arr.length-1].set('hasSubItems', true);
arr.push(new Common.UI.TreeViewModel({
name : range.asc_getName(),
name : (range.asc_getIsXlnm() && sheets[scope] ? sheets[scope].name + '!' : '') + range.asc_getName(), // add sheet name for print area
level: 1,
index: arr.length,
type: 1, // defined name
@ -386,6 +391,7 @@ define([
}));
prev_level = 1;
}
}
store.reset(arr);
var sheet = props ? (props.asc_getSheet() || props.asc_getLocation()) : this.settings.currentSheet,
rec = store.findWhere({name: sheet });