Merge pull request #4379 from caugner/disable-pasting-hack-for-firefox-50

FIX: Disable pasting hack for Firefox 50+
This commit is contained in:
Robin Ward 2016-08-10 10:38:48 -04:00 committed by GitHub
commit 24201d4638

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