Created
August 26, 2015 08:28
-
-
Save JonCatmull/ec8eb9488955f2be3163 to your computer and use it in GitHub Desktop.
Fix for redactor in chrome
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Place inside setEvents: function() { on line 1361 | |
// Check for chrome span bug | |
this.$editor.on("DOMNodeInserted", $.proxy(function(e) { | |
if (e.target.tagName == "SPAN" ) { | |
console.log('clean spans'); | |
var helper = $("<b>helper</b>"); | |
$(e.target).before(helper); | |
helper.after($(e.target).contents()); | |
helper.remove(); | |
$(e.target).remove(); | |
} | |
}, this)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
credit too http://www.neotericdesign.com/blog/2013/3/working-around-chrome-s-contenteditable-span-bug