Skip to content

Commit

Permalink
erroneous links to ZMSFies in CK-Editor (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmsdev committed Sep 25, 2023
1 parent 8ab6bb0 commit b6cfc37
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1280,18 +1280,19 @@ ZMIObjectTree.prototype.addPages = function(nodes) {
// Ensure nodes as list type
nodes = nodes.length==undefined ? [nodes] : nodes;
nodes.forEach(node => {
var data_id = '{$'+node.uid+'}';
var link_url = node.index_html;
var icon = that.metamodel[node.meta_id] ? $ZMI.icon(that.metamodel[node.meta_id].icon_clazz) : $ZMI.icon('far fa-file');
var anchor = '';
var css = [ node.is_page ? 'is_page' : 'is_page_element' ];
var callback = that.p['toggleClick.callback'];

if (node.meta_id == 'ZMSGraphic' && link_url) {
link_url = `<img data-id=&quot;${node.uid}&quot; src=&quot;${link_url}&quot;>`;
link_url = `<img data-id=&quot;${data_id}&quot; src=&quot;${link_url}&quot;>`;
} else if (node.meta_id == 'ZMSFile' && link_url) {
var $path_elements = link_url.split('/');
var $fname = $path_elements[$path_elements.length -1 ].split('?')[0];
link_url = `<a data-id=&quot;${node.uid}&quot; src=&quot;${link_url}&quot; target=&quot;_blank&quot;>${$fname}</a>`;
link_url = `<a data-id=&quot;${data_id}&quot; src=&quot;${link_url}&quot; target=&quot;_blank&quot;>${$fname}</a>`;
};
if (!node.active) {
css.push("inactive");
Expand Down

0 comments on commit b6cfc37

Please sign in to comment.