mirror of
https://github.com/moodle/moodle.git
synced 2025-04-13 12:32:08 +02:00
MDL-23308, fixed course files tree file download link
This commit is contained in:
parent
b285c5aa42
commit
3ac06cc25a
@ -31,9 +31,10 @@ M.core_filetree = {
|
||||
var tmp = new YAHOO.widget.HTMLNode('<div>'+data[i].icon+' <a href="'+data[i].url+'">'+data[i].filename+'</a></div>', node, false);
|
||||
if (data[i].isdir) {
|
||||
tmp.isLeaf = false;
|
||||
tmp.isDir = true;
|
||||
} else {
|
||||
tmp.isLeaf = true;
|
||||
tmp.target = '_blank';
|
||||
tmp.isFile = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -60,8 +61,10 @@ M.core_filetree = {
|
||||
for (i in children) {
|
||||
if (children[i].className == 'file-tree-folder') {
|
||||
children[i].isLeaf = false;
|
||||
children[i].isDir = true;
|
||||
} else {
|
||||
children[i].isLeaf = true;
|
||||
children[i].isFile = true;
|
||||
}
|
||||
}
|
||||
tree.render();
|
||||
@ -71,10 +74,18 @@ M.core_filetree = {
|
||||
var tmp = document.createElement('p');
|
||||
tmp.innerHTML = node.html;
|
||||
var links = tmp.getElementsByTagName('a');
|
||||
M.core_filetree.request(links[0].href, node, oncompletecb);
|
||||
var link = links[0].href;
|
||||
M.core_filetree.request(link, node, oncompletecb);
|
||||
},
|
||||
onclick: function(e) {
|
||||
YAHOO.util.Event.preventDefault(e);
|
||||
if (e.node.isFile) {
|
||||
var tmp = document.createElement('p');
|
||||
tmp.innerHTML = e.node.html;
|
||||
var links = tmp.getElementsByTagName('a');
|
||||
var link = links[0].href;
|
||||
window.location = link;
|
||||
}
|
||||
},
|
||||
get_param: function(url, name, val) {
|
||||
name = name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");
|
||||
|
Loading…
x
Reference in New Issue
Block a user