Skip to content

Commit

Permalink
Merge pull request #8259 from RocketChat/fix-popover-clipboard
Browse files Browse the repository at this point in the history
[FIX] clipboard and permalink on new popover
  • Loading branch information
engelgabriel authored and rodrigok committed Sep 23, 2017
1 parent 9ffb19a commit b04faf8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 4 additions & 0 deletions packages/rocketchat-ui/client/views/app/popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ this.popover = {
};

Template.popover.onRendered(function() {
if (this.data.onRendered) {
this.data.onRendered();
}

$('.rc-popover').click(function(e) {
if (e.currentTarget === e.target) {
popover.close();
Expand Down
9 changes: 6 additions & 3 deletions packages/rocketchat-ui/client/views/app/room.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* globals RocketChatTabBar , chatMessages, fileUpload , fireGlobalEvent , mobileMessageMenu , cordova , readMessage , RoomRoles, popover*/
/* globals RocketChatTabBar , chatMessages, fileUpload , fireGlobalEvent , mobileMessageMenu , cordova , readMessage , RoomRoles, popover */
import moment from 'moment';
import mime from 'mime-type/with-db';
import Clipboard from 'clipboard';

window.chatMessages = window.chatMessages || {};
const socialSharing = (options = {}) => window.plugins.socialsharing.share(options.message, options.subject, options.file, options.link);
Expand Down Expand Up @@ -551,7 +552,8 @@ Template.room.events({
icon: item.icon,
name: t(item.label),
type: 'message-action',
id: item.id
id: item.id,
modifier: item.id === 'delete-message' ? 'error' : null
};
});

Expand All @@ -571,7 +573,8 @@ Template.room.events({
x: e.clientX,
y: e.clientY
},
activeElement: $(e.currentTarget).parents('.message')[0]
activeElement: $(e.currentTarget).parents('.message')[0],
onRendered: () => new Clipboard('.rc-popover__item')
};

popover.open(config);
Expand Down
4 changes: 4 additions & 0 deletions packages/rocketchat-ui/package.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Package.describe({
documentation: 'README.md'
});

Npm.depends({
clipboard: '1.7.1'
});

Package.onUse(function(api) {
api.use([
'accounts-base',
Expand Down

0 comments on commit b04faf8

Please sign in to comment.