Merge pull request #3246 from owncloud/newfile-mimetype
Files: set the proper mimetype when creating a new text file
This commit is contained in:
commit
deb0885e46
|
@ -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 New Issue