diff options
author | Lukas Reschke <lukas@owncloud.com> | 2015-02-27 18:40:53 +0100 |
---|---|---|
committer | Lukas Reschke <lukas@owncloud.com> | 2015-02-27 18:40:53 +0100 |
commit | 13b0b7dfaf6553411928677420d8d21fa352bb3e (patch) | |
tree | eb95fcff49a3310e2eaac186ac2bbda5521e91bd /core | |
parent | b4dfd043d7eef8767cf6727cb0651851b8139da7 (diff) | |
parent | 92b5517229e4d56fc64b91898c9950bd670f893e (diff) | |
download | nextcloud-server-13b0b7dfaf6553411928677420d8d21fa352bb3e.tar.gz nextcloud-server-13b0b7dfaf6553411928677420d8d21fa352bb3e.zip |
Merge pull request #14585 from owncloud/fix-avatars-for-users-with-at
Use custom attribute instead of the div identifier
Diffstat (limited to 'core')
-rw-r--r-- | core/js/share.js | 4 | ||||
-rw-r--r-- | core/js/tests/specs/shareSpec.js | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/core/js/share.js b/core/js/share.js index 692ce0b0ba0..2370916e8be 100644 --- a/core/js/share.js +++ b/core/js/share.js @@ -666,7 +666,7 @@ OC.Share={ html += '<a href="#" class="unshare"><img class="svg" alt="'+t('core', 'Unshare')+'" title="'+t('core', 'Unshare')+'" src="'+OC.imagePath('core', 'actions/delete')+'"/></a>'; if (oc_config.enable_avatars === true) { if (shareType === OC.Share.SHARE_TYPE_USER) { - html += '<div id="avatar-' + escapeHTML(shareWith) + '" class="avatar"></div>'; + html += '<div data-user="' + escapeHTML(shareWith) + '" class="avatar"></div>'; } else { html += '<div class="avatar" style="padding-right: 32px"></div>'; } @@ -703,7 +703,7 @@ OC.Share={ html += '</li>'; html = $(html).appendTo('#shareWithList'); if (oc_config.enable_avatars === true && shareType === OC.Share.SHARE_TYPE_USER) { - $('#avatar-' + escapeHTML(shareWith)).avatar(escapeHTML(shareWith), 32); + $('.avatar[data-user="' + escapeHTML(shareWith) + '"]').avatar(escapeHTML(shareWith), 32); } // insert cruds button into last label element var lastLabel = html.find('>label:last'); diff --git a/core/js/tests/specs/shareSpec.js b/core/js/tests/specs/shareSpec.js index 1856fc27bc6..bcdc1df3d37 100644 --- a/core/js/tests/specs/shareSpec.js +++ b/core/js/tests/specs/shareSpec.js @@ -459,7 +459,7 @@ describe('OC.Share tests', function() { expect($('#shareWithList').children().length).toEqual(2); - expect($('#avatar-user1').length).toEqual(1); + expect($('.avatar[data-user="user1"]').length).toEqual(1); expect(args.length).toEqual(2); expect(args[0]).toEqual('user1'); }); |