summaryrefslogtreecommitdiffstats
path: root/apps/files_texteditor
diff options
context:
space:
mode:
authorTom Needham <needham.thomas@gmail.com>2012-01-09 17:22:51 +0000
committerTom Needham <needham.thomas@gmail.com>2012-01-09 17:22:51 +0000
commit19186bf37b131c76146b27f15c337c49e54d42cd (patch)
tree88196c9db550971736532cce416824ca873714c1 /apps/files_texteditor
parent18b8dc1c2120b7d7ab6e4a7f23c33a6019e1587b (diff)
downloadnextcloud-server-19186bf37b131c76146b27f15c337c49e54d42cd.tar.gz
nextcloud-server-19186bf37b131c76146b27f15c337c49e54d42cd.zip
hide save button for read-only files
Diffstat (limited to 'apps/files_texteditor')
-rw-r--r--apps/files_texteditor/js/editor.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/apps/files_texteditor/js/editor.js b/apps/files_texteditor/js/editor.js
index 3c1e1542806..664dd0f1e6e 100644
--- a/apps/files_texteditor/js/editor.js
+++ b/apps/files_texteditor/js/editor.js
@@ -54,11 +54,14 @@ function setSyntaxMode(ext){
}
}
-function showControls(filename){
+function showControls(filename,writeperms){
// Loads the control bar at the top.
$('.actions,#file_action_panel').fadeOut('slow').promise().done(function() {
// Load the new toolbar.
- var savebtnhtml = '<input type="button" id="editor_save" value="'+t('files_texteditor','Save')+'">';
+ var savebtnhtml;
+ if(writeperms=="true"){
+ var savebtnhtml = '<input type="button" id="editor_save" value="'+t('files_texteditor','Save')+'">';
+ }
var html = '<input type="button" id="editor_close" value="Close">';
$('#controls').append(html);
$('#editorbar').fadeIn('slow');
@@ -134,7 +137,7 @@ function showFileEditor(dir,filename){
// Save mtime
$('#editor').attr('data-mtime', result.data.mtime);
// Initialise the editor
- showControls(filename);
+ showControls(filename,result.data.write);
$('table').fadeOut('slow', function() {
$('#editor').text(result.data.filecontents);
$('#editor').attr('data-dir', dir);