[Pkg-owncloud-commits] [owncloud] 94/131: Adding error handling in case setting the password fails
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 15:58:37 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to annotated tag v8.1.1
in repository owncloud.
commit a53b7e3240820cee90f2839e3e2d3e0c06cc9d09
Author: Thomas Müller <thomas.mueller at tmit.eu>
Date: Thu Jul 23 09:39:26 2015 +0200
Adding error handling in case setting the password fails
---
core/js/share.js | 17 ++++++++++++-----
1 file changed, 12 insertions(+), 5 deletions(-)
diff --git a/core/js/share.js b/core/js/share.js
index c0bc2c8..d730d3b 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -308,7 +308,7 @@ OC.Share={
return data;
},
- share:function(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, expirationDate, callback) {
+ share:function(itemType, itemSource, shareType, shareWith, permissions, itemSourceName, expirationDate, callback, errorCallback) {
// Add a fallback for old share() calls without expirationDate.
// We should remove this in a later version,
// after the Apps have been updated.
@@ -339,12 +339,15 @@ OC.Share={
callback(result.data);
}
} else {
- if (result.data && result.data.message) {
- var msg = result.data.message;
- } else {
+ if (_.isUndefined(errorCallback)) {
var msg = t('core', 'Error');
+ if (result.data && result.data.message) {
+ msg = result.data.message;
+ }
+ OC.dialogs.alert(msg, t('core', 'Error while sharing'));
+ } else {
+ errorCallback(result);
}
- OC.dialogs.alert(msg, t('core', 'Error while sharing'));
}
}
);
@@ -1178,6 +1181,10 @@ $(document).ready(function() {
OC.Share.updateIcon(itemType, itemSource);
}
$('#dropdown').trigger(new $.Event('sharesChanged', {shares: OC.Share.currentShares}));
+ }, function(result) {
+ $loading.addClass('hidden');
+ linkPassText.val('');
+ linkPassText.attr('placeholder', result.data.message);
});
if (expireDateString !== '') {
--
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