diff options
author | Robin Appelman <icewind@owncloud.com> | 2013-05-06 17:55:22 +0200 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2013-05-06 17:55:22 +0200 |
commit | 3de40f7cfb779b570761dedc837cb3a6bfd0e878 (patch) | |
tree | 52a66f070e6f6c5d02729585cf57f5002cb5e964 /apps/files | |
parent | d659d8e1931eb36de88b21647234ef3748ef7e5a (diff) | |
download | nextcloud-server-3de40f7cfb779b570761dedc837cb3a6bfd0e878.tar.gz nextcloud-server-3de40f7cfb779b570761dedc837cb3a6bfd0e878.zip |
Files: set the proper mimetype when creating a new text file
Diffstat (limited to 'apps/files')
-rw-r--r-- | apps/files/ajax/newfile.php | 2 | ||||
-rw-r--r-- | apps/files/js/files.js | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/apps/files/ajax/newfile.php b/apps/files/ajax/newfile.php index 38714f34a63..8548fc95ddf 100644 --- a/apps/files/ajax/newfile.php +++ b/apps/files/ajax/newfile.php @@ -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(); } } diff --git a/apps/files/js/files.js b/apps/files/js/files.js index 296e54e3568..a15f0588f9f 100644 --- a/apps/files/js/files.js +++ b/apps/files/js/files.js @@ -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 { |