FIX: Disable pasting hack for Firefox 50+

This commit is contained in:
Claas Augner 2016-08-10 01:24:15 +02:00
parent 8321bdab4e
commit ac87a86975
No known key found for this signature in database
GPG Key ID: 63E8BCF5EB1A35AE
1 changed files with 7 additions and 1 deletions

View File

@ -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 => {