[Pkg-owncloud-commits] [owncloud] 15/34: fix deletion of shares
David Prévot
taffit at moszumanska.debian.org
Thu Nov 13 19:37:13 UTC 2014
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v6.0.6
in repository owncloud.
commit cb74d8ac0e319468b834a1bf046693c067fae991
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date: Thu Aug 21 15:11:21 2014 +0200
fix deletion of shares
---
apps/files_external/js/settings.js | 45 +++++++++++++++++++-------------------
1 file changed, 23 insertions(+), 22 deletions(-)
diff --git a/apps/files_external/js/settings.js b/apps/files_external/js/settings.js
index 4748e1d..50ca282 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();
@@ -41,12 +49,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;
@@ -197,7 +200,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) {
@@ -393,7 +396,7 @@ $(document).ready(function() {
OC.MountConfig.saveStorage($(this).parent());
});
- $('#sslCertificate').on('click', 'td.remove>img', function() {
+ $('#sslCertificate').on('click', 'td.remove>img', function() {
var $tr = $(this).parent().parent();
var row = this.parentNode.parentNode;
$.post(OC.filePath('files_external', 'ajax', 'removeRootCertificate.php'), {cert: row.id});
@@ -407,20 +410,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;
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git
More information about the Pkg-owncloud-commits
mailing list