From 881340213ecc28977db189da3d7005903083d3fc Mon Sep 17 00:00:00 2001 From: Vikhyat Korrapati Date: Mon, 24 Mar 2014 22:33:20 +0530 Subject: [PATCH] Fix pasting into the subject field in Firefox. --- .../javascripts/discourse/views/composer/composer_view.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/assets/javascripts/discourse/views/composer/composer_view.js b/app/assets/javascripts/discourse/views/composer/composer_view.js index ee4cb67b86e..01eb1cd38a3 100644 --- a/app/assets/javascripts/discourse/views/composer/composer_view.js +++ b/app/assets/javascripts/discourse/views/composer/composer_view.js @@ -328,8 +328,8 @@ Discourse.ComposerView = Discourse.View.extend(Ember.Evented, { var uaMatch = navigator.userAgent.match(/Firefox\/(\d+)\.\d/); if (uaMatch && parseInt(uaMatch[1]) >= 24) { self.$().append( Ember.$("
") ); - self.$().off('keydown.contenteditable'); - self.$().on('keydown.contenteditable', function(event) { + self.$("textarea").off('keydown.contenteditable'); + self.$("textarea").on('keydown.contenteditable', function(event) { // Catch Ctrl+v / Cmd+v and hijack focus to a contenteditable div. We can't // use the onpaste event because for some reason the paste isn't resumed // after we switch focus, probably because it is being executed too late.