summaryrefslogtreecommitdiffstats
path: root/core/js/sharedialoglinkshareview.js
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-01-22 17:30:18 +0100
committerVincent Petry <pvince81@owncloud.com>2016-01-28 15:25:34 +0100
commitb063ddb05b71988d92fe140ca003ad58301cfcc8 (patch)
treefebf5d75ec2f5c4d4759d0ab2ad12523ea66a0a6 /core/js/sharedialoglinkshareview.js
parent476720ada9f0997bdef7407f8ef15c2c50866011 (diff)
downloadnextcloud-server-b063ddb05b71988d92fe140ca003ad58301cfcc8.tar.gz
nextcloud-server-b063ddb05b71988d92fe140ca003ad58301cfcc8.zip
Share dialog use OCS API
Diffstat (limited to 'core/js/sharedialoglinkshareview.js')
-rw-r--r--core/js/sharedialoglinkshareview.js22
1 files changed, 15 insertions, 7 deletions
diff --git a/core/js/sharedialoglinkshareview.js b/core/js/sharedialoglinkshareview.js
index 452599fb7f2..efae618ba99 100644
--- a/core/js/sharedialoglinkshareview.js
+++ b/core/js/sharedialoglinkshareview.js
@@ -157,8 +157,9 @@
onShowPasswordClick: function() {
this.$el.find('.linkPass').slideToggle(OC.menuSpeed);
if(!this.$el.find('.showPasswordCheckbox').is(':checked')) {
- this.model.setPassword('');
- this.model.saveLinkShare();
+ this.model.saveLinkShare({
+ password: ''
+ });
} else {
this.$el.find('.linkPassText').focus();
}
@@ -171,7 +172,6 @@
},
onPasswordEntered: function() {
- var self = this;
var $loading = this.$el.find('.linkPass .icon-loading-small');
if (!$loading.hasClass('hidden')) {
// still in process
@@ -189,8 +189,9 @@
.removeClass('hidden')
.addClass('inlineblock');
- this.model.setPassword(password);
- this.model.saveLinkShare({}, {
+ this.model.saveLinkShare({
+ password: password
+ }, {
error: function(model, msg) {
$loading.removeClass('inlineblock').addClass('hidden');
$input.addClass('error');
@@ -204,8 +205,15 @@
onAllowPublicUploadChange: function() {
var $checkbox = this.$('.publicUploadCheckbox');
$checkbox.siblings('.icon-loading-small').removeClass('hidden').addClass('inlineblock');
- this.model.setPublicUpload($checkbox.is(':checked'));
- this.model.saveLinkShare();
+
+ var permissions = OC.PERMISSION_READ;
+ if($checkbox.is(':checked')) {
+ permissions = OC.PERMISSION_UPDATE | OC.PERMISSION_CREATE | OC.PERMISSION_READ;
+ }
+
+ this.model.saveLinkShare({
+ permissions: permissions
+ });
},
_onEmailPrivateLink: function(event) {