Skip to content

Commit

Permalink
Refs wymeditorgh-228. Fixed FF bug where double-clicking in the white…
Browse files Browse the repository at this point in the history
…space next to a header would turn it in to a paragraph
  • Loading branch information
winhamwr committed Jul 13, 2011
1 parent 36cd243 commit 91d9f72
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/wymeditor/jquery.wymeditor.mozilla.js
Expand Up @@ -302,7 +302,14 @@ WYMeditor.WymClassMozilla.prototype.click = function(evt) {
if (container && container.tagName.toLowerCase() == WYMeditor.BODY) {
// A click in the body means there is no content at all, so we
// should automatically create a starter paragraph
wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P);
var sel = wym._iframe.contentWindow.getSelection();
if (sel.isCollapsed === true) {
// If the selection isn't collapsed, we might have a selection that
// drags over the body, but we shouldn't turn everything in to a
// paragraph tag. Otherwise, double-clicking in the space to the
// right of an h2 tag would turn it in to a paragraph
wym._exec(WYMeditor.FORMAT_BLOCK, WYMeditor.P);
}
}
};

Expand Down

0 comments on commit 91d9f72

Please sign in to comment.