forked from extern/egroupware
fixed File name+link widget to display clickable path components used in filemanager when files from subdirs is selected
This commit is contained in:
parent
cfa9c190bb
commit
4e0ea875b9
@ -52,12 +52,16 @@ var et2_vfs = et2_valueWidget.extend([et2_IDetachedDOM], {
|
|||||||
this.span.empty().text(_value);
|
this.span.empty().text(_value);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var path_parts = _value.path ? _value.path.split('/') : [];
|
var path = _value.path ? _value.path : '/';
|
||||||
|
// calculate path as parent of name, which can contain slashes
|
||||||
|
// eg. _value.path=/home/ralf/sub/file, _value.name=sub/file --> path=/home/ralf
|
||||||
|
// --> generate clickable fields for sub/ + file
|
||||||
|
path = path.substr(0, _value.path.length-_value.name.length-1);
|
||||||
|
var path_offset = path.split('/').length;
|
||||||
|
var path_parts = _value.path.split('/');
|
||||||
|
|
||||||
var text;
|
var text;
|
||||||
var path = '/';
|
for(var i = path_offset; i < path_parts.length; i++)
|
||||||
var mime = this.DIR_MIME_TYPE;
|
|
||||||
for(var i = 0; i < path_parts.length; i++)
|
|
||||||
{
|
{
|
||||||
path += (path=='/'?'':'/')+path_parts[i];
|
path += (path=='/'?'':'/')+path_parts[i];
|
||||||
text = egw.decodePath(path_parts[i]);
|
text = egw.decodePath(path_parts[i]);
|
||||||
@ -87,25 +91,17 @@ var et2_vfs = et2_valueWidget.extend([et2_IDetachedDOM], {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
path_parts[i] = text;
|
var data = {path: path, type: i < path_parts.length-1 ? this.DIR_MIME_TYPE : _value.mime };
|
||||||
|
|
||||||
// TODO: This is apparently not used in old etemplate
|
|
||||||
/*
|
|
||||||
var part = $j(document.createElement("li"))
|
var part = $j(document.createElement("li"))
|
||||||
.addClass("vfsFilename")
|
.addClass("vfsFilename")
|
||||||
.text(text)
|
.text(text + (i < path_parts.length-1 ? '/' : ''))
|
||||||
|
//.attr('title', egw.decodePath(path))
|
||||||
|
.addClass("et2_clickable et2_link")
|
||||||
|
.click({data:data, egw: this.egw()}, function(e) {
|
||||||
|
e.data.egw.open(e.data.data, "file");
|
||||||
|
})
|
||||||
.appendTo(this.span);
|
.appendTo(this.span);
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
var data = {path: path, type: i==path_parts.length-1 ? _value.mime : this.DIR_MIME_TYPE };
|
|
||||||
var part = $j(document.createElement("li"))
|
|
||||||
.addClass("vfsFilename")
|
|
||||||
.text(text)
|
|
||||||
.addClass("et2_clickable et2_link")
|
|
||||||
.click({data:data, egw: this.egw()}, function(e) {
|
|
||||||
e.data.egw.open(e.data.data, "file");
|
|
||||||
})
|
|
||||||
.appendTo(this.span);
|
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -458,7 +458,6 @@ ul.et2_vfs {
|
|||||||
display: inline;
|
display: inline;
|
||||||
}
|
}
|
||||||
.et2_vfs li.vfsFilename:not(:last-child):after {
|
.et2_vfs li.vfsFilename:not(:last-child):after {
|
||||||
content: '/';
|
|
||||||
padding: 0.25ex;
|
padding: 0.25ex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user