aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2013-10-22 23:06:53 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2013-10-22 23:06:53 +0200
commit9019ad550fc4c8e6d636eaaf98062ba2e495d135 (patch)
tree92b0e3e7e34dd1a5497fc2f62b30085af41317cd /apps
parentca3771f8fd761a51ea7bbe123dcb16c5da7f4045 (diff)
parentd2fa0f5ff208dc5e043109a8d08b58bf344d24b3 (diff)
downloadnextcloud-server-9019ad550fc4c8e6d636eaaf98062ba2e495d135.tar.gz
nextcloud-server-9019ad550fc4c8e6d636eaaf98062ba2e495d135.zip
Merge branch 'master' into prevent_user_from_creating_or_renaming_to_an_existing_filename
Conflicts: apps/files/js/filelist.js
Diffstat (limited to 'apps')
-rw-r--r--apps/files/js/filelist.js32
1 files changed, 29 insertions, 3 deletions
diff --git a/apps/files/js/filelist.js b/apps/files/js/filelist.js
index 694ddb0c803..78eaa9761a0 100644
--- a/apps/files/js/filelist.js
+++ b/apps/files/js/filelist.js
@@ -252,9 +252,35 @@ var FileList={
$('.creatable').toggleClass('hidden', !isCreatable);
$('.notCreatable').toggleClass('hidden', isCreatable);
},
- remove:function(name) {
- $('tr[data-file="'+name+'"]').find('td.filename').draggable('destroy');
- $('tr[data-file="'+name+'"]').remove();
+
+ /**
+ * Shows/hides action buttons
+ *
+ * @param show true for enabling, false for disabling
+ */
+ showActions: function(show){
+ $('.actions,#file_action_panel').toggleClass('hidden', !show);
+ if (show){
+ // make sure to display according to permissions
+ var permissions = $('#permissions').val();
+ var isCreatable = (permissions & OC.PERMISSION_CREATE) !== 0;
+ $('.creatable').toggleClass('hidden', !isCreatable);
+ $('.notCreatable').toggleClass('hidden', isCreatable);
+ }
+ },
+ /**
+ * Enables/disables viewer mode.
+ * In viewer mode, apps can embed themselves under the controls bar.
+ * In viewer mode, the actions of the file list will be hidden.
+ * @param show true for enabling, false for disabling
+ */
+ setViewerMode: function(show){
+ this.showActions(!show);
+ $('#filestable').toggleClass('hidden', show);
+ },
+ remove:function(name){
+ $('tr').filterAttr('data-file',name).find('td.filename').draggable('destroy');
+ $('tr').filterAttr('data-file',name).remove();
FileList.updateFileSummary();
if ( ! $('tr[data-file]').exists() ) {
$('#emptycontent').removeClass('hidden');