Files: set the proper mimetype when creating a new text file
This commit is contained in:
parent
d659d8e193
commit
3de40f7cfb
2 changed files with 3 additions and 3 deletions
|
@ -85,7 +85,7 @@ if($source) {
|
|||
}elseif(\OC\Files\Filesystem::touch($dir . '/' . $filename)) {
|
||||
$meta = \OC\Files\Filesystem::getFileInfo($dir.'/'.$filename);
|
||||
$id = $meta['fileid'];
|
||||
OCP\JSON::success(array("data" => array('content'=>$content, 'id' => $id)));
|
||||
OCP\JSON::success(array("data" => array('content'=>$content, 'id' => $id, 'mime' => $meta['mimetype'])));
|
||||
exit();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -511,9 +511,9 @@ $(document).ready(function() {
|
|||
var date=new Date();
|
||||
FileList.addFile(name,0,date,false,hidden);
|
||||
var tr=$('tr').filterAttr('data-file',name);
|
||||
tr.attr('data-mime','text/plain');
|
||||
tr.attr('data-mime',result.data.mime);
|
||||
tr.attr('data-id', result.data.id);
|
||||
getMimeIcon('text/plain',function(path){
|
||||
getMimeIcon(result.data.mime,function(path){
|
||||
tr.find('td.filename').attr('style','background-image:url('+path+')');
|
||||
});
|
||||
} else {
|
||||
|
|
Loading…
Reference in a new issue