Skip to content

AddFolder stores wrong folder path in data-path #465

Open
@JosHuybrighs

Description

@JosHuybrighs

When adding a folder the path to the new folder is not constructed correctly.
The code that is currently in master (and also in 2.4.0, which I am using) is:

var addFolder = function(parent, name) {
        var newNode = '<li class="directory collapsed"><a data-path="' + parent + name + '/" href="#">' + name + '</a><ul class="jqueryFileTree" style="display: block;"></ul></li>';
        var parentNode = $('#filetree').find('a[data-path="' + parent + '"]');
    ...

Must be:

var addFolder = function(parent, name) {
    var dataPath = parent + '/' + name;
    var newNode = '<li class="directory collapsed"><a data-path="' + dataPath + '/" href="#">' + name + '</a><ul class="jqueryFileTree" style="display: block;"></ul></li>';
    var parentNode = $('#filetree').find('a[data-path="' + parent + '"]');
    ...

Unless I'am overlooking something?

Best regards,
Jos

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions