From 9e5d6fe1c1e27f911ed59063a7d0b671de1e3cc0 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 3 Dec 2015 14:59:05 +0100 Subject: [PATCH] Disable Save button in manticore session when the file/folder is not writable --- plugins/kolab_files/kolab_files.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/kolab_files/kolab_files.js b/plugins/kolab_files/kolab_files.js index cb5520bf..62404bed 100644 --- a/plugins/kolab_files/kolab_files.js +++ b/plugins/kolab_files/kolab_files.js @@ -154,9 +154,11 @@ function kolab_files_init() photo_url: '?_task=addressbook&_action=photo&_email=%email', photo_default_url: rcmail.env.photo_placeholder, // events - ready: function(data) { manticore_init(); }, - documentChanged: function(data) { rcmail.enable_command('document-save', true); }, + ready: function(data) { manticore_init(); } }; + + if (rcmail.env.file_data.writable) + manticore_config.documentChanged = function(data) { rcmail.enable_command('document-save', true); }; } else if (rcmail.env.action == 'open') { // initialize folders list (for dialogs)