FileActions.currentFile = parent;
var actions = FileActions.get(FileActions.getCurrentMimeType(), FileActions.getCurrentType(), FileActions.getCurrentPermissions());
var file = FileActions.getCurrentFile();
- if ($('tr').filterAttr('data-file', file).data('renaming')) {
+ if ($('tr[data-file="'+file+'"]').data('renaming')) {
return;
}
parent.children('a.name').append('<span class="fileactions" />');
window.location = OC.filePath('files', 'ajax', 'download.php') + '?files=' + encodeURIComponent(filename) + '&dir=' + encodeURIComponent($('#dir').val());
});
}
-
$('#fileList tr').each(function () {
FileActions.display($(this).children('td.filename'));
});
+
+ $('#fileList').trigger(jQuery.Event("fileActionsReady"));
});
if (typeof OC.Share !== 'undefined' && typeof FileActions !== 'undefined' && !disableSharing) {
+ $('#fileList').one('fileActionsReady',function(){
+ OC.Share.loadIcons('file');
+ });
+
FileActions.register('all', 'Share', OC.PERMISSION_READ, OC.imagePath('core', 'actions/share'), function(filename) {
if ($('#dir').val() == '/') {
var item = $('#dir').val() + filename;
OC.Share.showDropDown(itemType, $(tr).data('id'), appendTo, true, possiblePermissions);
}
});
- OC.Share.loadIcons('file');
}
-});
+});
\ No newline at end of file
if (itemType != 'file' && itemType != 'folder') {
$('a.share[data-item="'+item+'"]').css('background', 'url('+image+') no-repeat center');
} else {
- var file = $('tr').filterAttr('data-id', item);
+ var file = $('tr[data-id="'+item+'"]');
if (file.length > 0) {
- var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share');
+ var action = $(file).find('.fileactions .action[data-action="Share"]');
var img = action.find('img').attr('src', image);
action.addClass('permanent');
action.html(' '+t('core', 'Shared')).prepend(img);
// Search for possible parent folders that are shared
while (path != last) {
if (path == data['path']) {
- var actions = $('.fileactions .action').filterAttr('data-action', 'Share');
+ var actions = $('.fileactions .action[data-action="Share"]');
$.each(actions, function(index, action) {
var img = $(action).find('img');
if (img.attr('src') != OC.imagePath('core', 'actions/public')) {