mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
Merge pull request #4379 from caugner/disable-pasting-hack-for-firefox-50
FIX: Disable pasting hack for Firefox 50+
This commit is contained in:
commit
24201d4638
1 changed files with 7 additions and 1 deletions
|
@ -296,7 +296,13 @@ export default Ember.Component.extend({
|
|||
// Believe it or not pasting an image in Firefox doesn't work without this code
|
||||
_firefoxPastingHack() {
|
||||
const uaMatch = navigator.userAgent.match(/Firefox\/(\d+)\.\d/);
|
||||
if (uaMatch && parseInt(uaMatch[1]) >= 24) {
|
||||
if (uaMatch) {
|
||||
let uaVersion = parseInt(uaMatch[1]);
|
||||
if (uaVersion < 24 || 50 <= uaVersion) {
|
||||
// The hack is no longer required in FF 50 and later.
|
||||
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=906420
|
||||
return;
|
||||
}
|
||||
this.$().append( Ember.$("<div id='contenteditable' contenteditable='true' style='height: 0; width: 0; overflow: hidden'></div>") );
|
||||
this.$("textarea").off('keydown.contenteditable');
|
||||
this.$("textarea").on('keydown.contenteditable', event => {
|
||||
|
|
Loading…
Reference in a new issue