Skip to content

Commit

Permalink
Sarting to drop Opera 12 support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Oliver Pulges committed Apr 25, 2014
1 parent 9b68b40 commit bae6f56
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 23 deletions.
5 changes: 0 additions & 5 deletions src/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -278,11 +278,6 @@ wysihtml5.browser = (function() {
return "getSelection" in window && "modify" in window.getSelection();
},

// Returns if there is a way for setting selection to expand a line
supportsSelectLine: function () {
return (this.supportsSelectionModify() || document.selection) ? true : false;
},

/**
* Opera needs a white space after a <br> in order to position the caret correctly
*/
Expand Down
23 changes: 5 additions & 18 deletions src/commands/formatBlock.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,24 +262,11 @@
}
}

if (wysihtml5.browser.supportsSelectLine()) {
_selectionWrap(composer, {
"nodeName": (nodeName || defaultNodeName),
"className": className || null,
"cssStyle": cssStyle || null
});
} else {
// Falling back to native command for Opera up to 12 mostly
// Native command does not create elements from selecton boundaries.
// Not quite user expected behaviour
// TODO: Also it does not support adding style. Drop opera 12 support or find a fallback
if (composer.commands.support(command)) {
_execCommand(doc, composer, command, nodeName || defaultNodeName, className);
return;
}
}


_selectionWrap(composer, {
"nodeName": (nodeName || defaultNodeName),
"className": className || null,
"cssStyle": cssStyle || null
});
},

state: function(composer, command, nodeName, className, classRegExp, cssStyle, styleRegExp) {
Expand Down

0 comments on commit bae6f56

Please sign in to comment.