diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2013-01-28 20:17:40 -0800 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2013-01-28 20:17:40 -0800 |
commit | 5143660cd35584dd0542ccfb57f6c0dff037928e (patch) | |
tree | 6debbbf1bb3b5b608db43752d851d3e04819db50 /core/js/share.js | |
parent | 8c4931a645bbd39606e51e7dd0bf6cfa625f1234 (diff) | |
parent | ed2ee8c411cdae7679944a8b6aac05425a51faed (diff) | |
download | nextcloud-server-5143660cd35584dd0542ccfb57f6c0dff037928e.tar.gz nextcloud-server-5143660cd35584dd0542ccfb57f6c0dff037928e.zip |
Merge pull request #1324 from owncloud/permanent-share-icons
Permanently display shared status icons
Diffstat (limited to 'core/js/share.js')
-rw-r--r-- | core/js/share.js | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/core/js/share.js b/core/js/share.js index bb3ec010ff5..b9b7201dd8b 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -23,7 +23,10 @@ OC.Share={ } else { var file = $('tr').filterAttr('data-file', OC.basename(item)); if (file.length > 0) { - $(file).find('.fileactions .action').filterAttr('data-action', 'Share').find('img').attr('src', image); + var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share'); + action.find('img').attr('src', image); + action.addClass('permanent'); + action.html(action.html().replace(t('core', 'Share'), t('core', 'Shared'))); } var dir = $('#dir').val(); if (dir.length > 1) { @@ -32,9 +35,12 @@ OC.Share={ // Search for possible parent folders that are shared while (path != last) { if (path == item) { - var img = $('.fileactions .action').filterAttr('data-action', 'Share').find('img'); + var action = $('.fileactions .action').filterAttr('data-action', 'Share'); + var img = action.find('img'); if (img.attr('src') != OC.imagePath('core', 'actions/public')) { img.attr('src', image); + action.addClass('permanent'); + action.html(action.html().replace(t('core', 'Share'), t('core', 'Shared'))); } } last = path; @@ -48,7 +54,8 @@ OC.Share={ }, updateIcon:function(itemType, itemSource) { if (itemType == 'file' || itemType == 'folder') { - var filename = $('tr').filterAttr('data-id', String(itemSource)).data('file'); + var file = $('tr').filterAttr('data-id', String(itemSource)); + var filename = file.data('file'); if ($('#dir').val() == '/') { itemSource = $('#dir').val() + filename; } else { @@ -75,6 +82,16 @@ OC.Share={ }); if (itemType != 'file' && itemType != 'folder') { $('a.share[data-item="'+itemSource+'"]').css('background', 'url('+image+') no-repeat center'); + } else { + var action = $(file).find('.fileactions .action').filterAttr('data-action', 'Share'); + action.find('img').attr('src', image); + if (shares) { + action.addClass('permanent'); + action.html(action.html().replace(t('core', 'Share'), t('core', 'Shared'))); + } else { + action.removeClass('permanent'); + action.html(action.html().replace(t('core', 'Shared'), t('core', 'Share'))); + } } if (shares) { OC.Share.statuses[itemSource] = link; |