From 5a789a4e11ff72ef5b01a9bafea83fb5b96b79f6 Mon Sep 17 00:00:00 2001 From: Karl Prieb Date: Fri, 26 May 2017 18:18:34 -0300 Subject: [PATCH] fix edit button on firefox --- .../client/views/channelSettings.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/packages/rocketchat-channel-settings/client/views/channelSettings.js b/packages/rocketchat-channel-settings/client/views/channelSettings.js index 4479caa45e996..d24806ba20b2c 100644 --- a/packages/rocketchat-channel-settings/client/views/channelSettings.js +++ b/packages/rocketchat-channel-settings/client/views/channelSettings.js @@ -108,11 +108,17 @@ Template.channelSettings.events({ t.saveSetting(); } }, - 'click [data-edit]'(e, t) { + 'click [data-edit], click .button.edit'(e, t) { e.preventDefault(); - if ($(e.currentTarget).data('edit')) { - t.editing.set($(e.currentTarget).data('edit')); - return setTimeout((function() { + let input = $(e.currentTarget); + + if (input.hasClass('button')) { + input = $(e.currentTarget).siblings('.current-setting'); + } + + if (input.data('edit')) { + t.editing.set(input.data('edit')); + setTimeout((function() { return t.$('input.editing').focus().select(); }), 100); }