fix vfs-path widget to correctly deal with smallPART paths (hierarchical structure inside entry directory)

This commit is contained in:
ralf 2022-04-01 21:00:17 +03:00
parent e5b82243fc
commit 98a08ec152
2 changed files with 29 additions and 18 deletions

View File

@ -333,14 +333,19 @@ var et2_vfsPath = /** @class */ (function (_super) {
text = this_2.egw().lang(path_parts[2]);
image = this_2.egw().image('navbar', path_parts[2].toLowerCase());
}
else if (!isNaN(text)) {
var link_title = this_2.egw().link_title(path_parts[2], path_parts[3], function (title) {
if (!title)
return;
jQuery('li', this.span).first().text(title);
}, this_2);
if (link_title && typeof link_title !== 'undefined')
else if (i === 3 && !isNaN(text)) {
// we first need to call link_title without callback, as callback would be called for cache-hits too!
var link_title = this_2.egw().link_title(path_parts[2], path_parts[3]);
if (link_title && typeof link_title !== 'undefined') {
text = link_title;
}
else {
this_2.egw().link_title(path_parts[2], path_parts[3], function (title) {
if (!title)
return;
jQuery('li', this.span).first().text(title);
}, this_2);
}
}
}
var self_2 = this_2;

View File

@ -383,17 +383,24 @@ export class et2_vfsPath extends et2_vfsName
text = this.egw().lang(path_parts[2]);
image = this.egw().image('navbar',path_parts[2].toLowerCase());
}
else if(!isNaN(<number><unknown>text))
else if(i === 3 && !isNaN(<number><unknown>text))
{
let link_title = this.egw().link_title(path_parts[2],path_parts[3],
function(title) {
if(!title) return;
jQuery('li',this.span).first().text(title);
}, this
);
if(link_title && typeof link_title !== 'undefined') text = link_title;
// we first need to call link_title without callback, as callback would be called for cache-hits too!
let link_title = this.egw().link_title(path_parts[2], path_parts[3]);
if(link_title && typeof link_title !== 'undefined')
{
text = link_title;
}
else
{
this.egw().link_title(path_parts[2], path_parts[3],
function(title) {
if(!title) return;
jQuery('li',this.span).first().text(title);
}, this
);
}
}
}
let self = this;
let node = jQuery(document.createElement("li"))
@ -1574,5 +1581,4 @@ export class et2_vfsSelect extends et2_inputWidget
return this.value;
}
};
et2_register_widget(et2_vfsSelect, ["vfs-select"]);
et2_register_widget(et2_vfsSelect, ["vfs-select"]);