From bae6f567a5d9e65e829290d5a92ea32a40deb292 Mon Sep 17 00:00:00 2001 From: Oliver Pulges Date: Fri, 25 Apr 2014 14:31:01 +0300 Subject: [PATCH] Sarting to drop Opera 12 support. --- src/browser.js | 5 ----- src/commands/formatBlock.js | 23 +++++------------------ 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/src/browser.js b/src/browser.js index cf1cafe..7b89bea 100644 --- a/src/browser.js +++ b/src/browser.js @@ -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
in order to position the caret correctly */ diff --git a/src/commands/formatBlock.js b/src/commands/formatBlock.js index 04ad873..a53a552 100644 --- a/src/commands/formatBlock.js +++ b/src/commands/formatBlock.js @@ -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) {