From 99e8a54a2782b281bf8de6d7d2d4c5175ddc613e Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 27 Oct 2015 10:46:18 +0000 Subject: [PATCH] Add linkify handlers --- src/skins/vector/views/pages/MatrixChat.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/skins/vector/views/pages/MatrixChat.js b/src/skins/vector/views/pages/MatrixChat.js index e1558459..2bedd6bf 100644 --- a/src/skins/vector/views/pages/MatrixChat.js +++ b/src/skins/vector/views/pages/MatrixChat.js @@ -25,6 +25,8 @@ var MatrixChatController = require('matrix-react-sdk/lib/controllers/pages/Matri var Loader = require("react-loader"); var dis = require('matrix-react-sdk/lib/dispatcher'); +var Matrix = require("matrix-js-sdk"); +var ContextualMenu = require("../../../../ContextualMenu"); module.exports = React.createClass({ @@ -46,6 +48,22 @@ module.exports = React.createClass({ window.removeEventListener('resize', this.handleResize); }, + onAliasClick: function(event, alias) { + event.preventDefault(); + dis.dispatch({action: 'view_room_alias', room_alias: alias}); + }, + + onUserClick: function(event, userId) { + event.preventDefault(); + var MemberInfo = sdk.getComponent('molecules.MemberInfo'); + var member = new Matrix.RoomMember(null, userId); + ContextualMenu.createMenu(MemberInfo, { + member: member, + right: window.innerWidth - event.pageX, + top: event.pageY + }); + }, + handleResize: function(e) { var hideLhsThreshold = 1000; var showLhsThreshold = 1000;