aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMichael Gapczynski <mtgap@owncloud.com>2012-07-10 18:56:22 -0400
committerMichael Gapczynski <mtgap@owncloud.com>2012-07-10 18:56:22 -0400
commit7c908a0016db30c70271304c4d080383911645e3 (patch)
treecc14759d9476d18310901acb9e48ef7445cb3c8a /core
parent1ad5e3e39f7e1c6d8279cf8e06781a8e6512b9fe (diff)
downloadnextcloud-server-7c908a0016db30c70271304c4d080383911645e3.tar.gz
nextcloud-server-7c908a0016db30c70271304c4d080383911645e3.zip
Sharing files working using share API
Diffstat (limited to 'core')
-rw-r--r--core/js/share.js18
1 files changed, 11 insertions, 7 deletions
diff --git a/core/js/share.js b/core/js/share.js
index 755e71e996e..3c7d2619eb2 100644
--- a/core/js/share.js
+++ b/core/js/share.js
@@ -84,10 +84,8 @@ OC.Share={
$(html).appendTo(appendTo);
var data = OC.Share.loadItem(itemType, item);
if (data) {
- $.each(data, function(index, shares) {
- $.each(shares, function(id, share) {
- OC.Share.addShareWith(share.share_with, share.permissions);
- });
+ $.each(data, function(index, share) {
+ OC.Share.addShareWith(share.share_with, share.permissions);
});
}
$('#dropdown').show('blind');
@@ -160,6 +158,7 @@ $(document).ready(function() {
});
if (typeof FileActions !== 'undefined') {
+
OC.Share.loadIcons('file');
FileActions.register('all', 'Share', function(filename) {
// Return the correct sharing icon
@@ -187,19 +186,24 @@ $(document).ready(function() {
}
}, function(filename) {
var item = $('#dir').val() + '/' + filename;
- var appendTo = $('tr').filterAttr('data-file',filename).find('td.filename');
+ if ($('tr').filterAttr('data-file', filename).data('type') == 'dir') {
+ var itemType = 'folder';
+ } else {
+ var itemType = 'file';
+ }
+ var appendTo = $('tr').filterAttr('data-file', filename).find('td.filename');
// Check if drop down is already visible for a different file
if (($('#dropdown').length > 0)) {
if (item != $('#dropdown').data('item')) {
OC.Share.hideDropDown(function () {
$('tr').removeClass('mouseOver');
$('tr').filterAttr('data-file', filename).addClass('mouseOver');
- OC.Share.showDropDown('file', item, appendTo, true);
+ OC.Share.showDropDown(itemType, item, appendTo, true);
});
}
} else {
$('tr').filterAttr('data-file',filename).addClass('mouseOver');
- OC.Share.showDropDown('file', item, appendTo, true);
+ OC.Share.showDropDown(itemType, item, appendTo, true);
}
});
}