Skip to content

Commit

Permalink
Just use insertHTML for all browsers for link breaks
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisledet committed Aug 27, 2014
1 parent 997e506 commit 3a2ecde
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions vendor/assets/javascripts/bootstrap-wysihtml5/wysihtml5.js
Original file line number Diff line number Diff line change
Expand Up @@ -5867,12 +5867,11 @@ wysihtml5.quirks.cleanPastedHTML = (function() {

if (keyCode === wysihtml5.ENTER_KEY && !wysihtml5.browser.insertsLineBreaksOnReturn()) {
composer.commands.exec("insertLineBreak");
event.preventDefault();
}

// keypress doesn't fire when you hit backspace
dom.observe(composer.element.ownerDocument, "keydown", keyDown);
}

// keypress doesn't fire when you hit backspace
dom.observe(composer.element.ownerDocument, "keydown", keyDown);
};
})(wysihtml5);/**
* Force rerendering of a given element
Expand Down Expand Up @@ -7472,14 +7471,7 @@ wysihtml5.Commands = Base.extend(

wysihtml5.commands.insertLineBreak = {
exec: function(composer, command) {
if (composer.commands.support(command)) {
composer.doc.execCommand(command, false, null);
if (!wysihtml5.browser.autoScrollsToCaret()) {
composer.selection.scrollIntoView();
}
} else {
composer.commands.exec("insertHTML", LINE_BREAK);
}
composer.commands.exec("insertHTML", LINE_BREAK);
},

state: function() {
Expand Down

0 comments on commit 3a2ecde

Please sign in to comment.