From 3d92f854101f05d18c0196022399e82230db773e Mon Sep 17 00:00:00 2001 From: Simon Grim Date: Wed, 30 Mar 2016 04:47:23 +0500 Subject: [PATCH] add auto focus on textarea when we open DMs --- js/twister_directmsg.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/js/twister_directmsg.js b/js/twister_directmsg.js index d3b5273..8df5aa5 100644 --- a/js/twister_directmsg.js +++ b/js/twister_directmsg.js @@ -212,7 +212,8 @@ function openDmWithUserModal(peerAlias) { requestDmConversationModal(modal.self.find('.direct-messages-thread').empty(), peerAlias); $('.dm-form-template').children().clone(true) - .addClass('open').appendTo(modal.content).fadeIn('fast'); + .addClass('open').appendTo(modal.content).fadeIn('fast') + .find('textarea').focus(); } function openGroupMessagesModal(groupAlias) { @@ -267,7 +268,8 @@ function openGroupMessagesModal(groupAlias) { ); $('.dm-form-template').children().clone(true) - .addClass('open').appendTo(req.modal.content).fadeIn('fast'); + .addClass('open').appendTo(req.modal.content).fadeIn('fast') + .find('textarea').focus(); } }, {groupAlias: groupAlias, modal: modal} );