summaryrefslogtreecommitdiffstats
path: root/apps/files_external
diff options
context:
space:
mode:
authorJörn Friedrich Dreyer <jfd@butonic.de>2014-08-21 15:11:21 +0200
committerJörn Friedrich Dreyer <jfd@butonic.de>2014-08-25 11:50:19 +0200
commit393d136faf76da2b9e3870d9219710d3939c5a83 (patch)
tree0ebcc643440e3d3d83fee094572fff2d3a13e2a9 /apps/files_external
parent308e8d63793761460b9d2a50d6f815403e106d83 (diff)
downloadnextcloud-server-393d136faf76da2b9e3870d9219710d3939c5a83.tar.gz
nextcloud-server-393d136faf76da2b9e3870d9219710d3939c5a83.zip
fix deletion of shares
Diffstat (limited to 'apps/files_external')
-rw-r--r--apps/files_external/js/settings.js43
1 files changed, 22 insertions, 21 deletions
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 69e99c03c89..ebc95d64cfd 100644
--- a/apps/files_external/js/settings.js
+++ b/apps/files_external/js/settings.js
@@ -11,6 +11,14 @@ function updateStatus(statusEl, result){
}
}
+function getSelection($row) {
+ var values = $row.find('.applicableUsers').select2('val');
+ if (!values || values.length === 0) {
+ values = ['all'];
+ }
+ return values;
+}
+
OC.MountConfig={
saveStorage:function(tr, callback) {
var mountPoint = $(tr).find('.mountPoint input').val();
@@ -42,12 +50,7 @@ OC.MountConfig={
}
});
if ($('#externalStorage').data('admin') === true) {
- var multiselect = $(tr).find('.applicableUsers').select2('val');
- if (multiselect == null) {
- return false;
- } else if (multiselect instanceof Array && multiselect.length === 0) {
- multiselect.push('all');
- }
+ var multiselect = getSelection($(tr));
}
if (addMountPoint) {
var status = false;
@@ -202,7 +205,7 @@ $(document).ready(function() {
return {
pattern: term, //search term
limit: userListLimit, // page size
- offset: userListLimit*(page-1), // page number starts with 0
+ offset: userListLimit*(page-1) // page number starts with 0
};
},
results: function (data, page) {
@@ -417,20 +420,18 @@ $(document).ready(function() {
if ($('#externalStorage').data('admin') === true) {
var isPersonal = false;
- var multiselect = $(tr).find('.chzn-select').val();
- if (multiselect != null) {
- $.each(multiselect, function(index, value) {
- var pos = value.indexOf('(group)');
- if (pos != -1) {
- var mountType = 'group';
- var applicable = value.substr(0, pos);
- } else {
- var mountType = 'user';
- var applicable = value;
- }
- $.post(OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), { mountPoint: mountPoint, mountType: mountType, applicable: applicable, isPersonal: isPersonal });
- });
- }
+ var multiselect = getSelection($(tr));
+ $.each(multiselect, function(index, value) {
+ var pos = value.indexOf('(group)');
+ if (pos != -1) {
+ var mountType = 'group';
+ var applicable = value.substr(0, pos);
+ } else {
+ var mountType = 'user';
+ var applicable = value;
+ }
+ $.post(OC.filePath('files_external', 'ajax', 'removeMountPoint.php'), { mountPoint: mountPoint, mountType: mountType, applicable: applicable, isPersonal: isPersonal });
+ });
} else {
var mountType = 'user';
var applicable = OC.currentUser;