Commit 474b1e00 authored by Eloy Lafuente's avatar Eloy Lafuente
Browse files

Merge branch 'MDL-51227-m28-master' of https://github.com/dthies/moodle into MOODLE_28_STABLE

parents 9194f591 a59f24b9
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
File suppressed by a .gitattributes entry or the file's encoding is unsupported.
...@@ -87,12 +87,9 @@ EditorStyling.prototype = { ...@@ -87,12 +87,9 @@ EditorStyling.prototype = {
*/ */
toggleInlineSelectionClass: function(toggleclasses) { toggleInlineSelectionClass: function(toggleclasses) {
var classname = toggleclasses.join(" "); var classname = toggleclasses.join(" ");
var originalSelection = this.getSelection();
var cssApplier = rangy.createCssClassApplier(classname, {normalize: true}); var cssApplier = rangy.createCssClassApplier(classname, {normalize: true});
cssApplier.toggleSelection(); cssApplier.toggleSelection();
this.setSelection(originalSelection);
}, },
/** /**
...@@ -100,12 +97,11 @@ EditorStyling.prototype = { ...@@ -100,12 +97,11 @@ EditorStyling.prototype = {
* *
* This will set inline styles on the current selection. * This will set inline styles on the current selection.
* *
* @method toggleInlineSelectionClass * @method formatSelectionInlineStyle
* @param {Array} styles - Style attributes to set on the nodes. * @param {Array} styles - Style attributes to set on the nodes.
*/ */
formatSelectionInlineStyle: function(styles) { formatSelectionInlineStyle: function(styles) {
var classname = this.PLACEHOLDER_CLASS; var classname = this.PLACEHOLDER_CLASS;
var originalSelection = this.getSelection();
var cssApplier = rangy.createCssClassApplier(classname, {normalize: true}); var cssApplier = rangy.createCssClassApplier(classname, {normalize: true});
cssApplier.applyToSelection(); cssApplier.applyToSelection();
...@@ -114,7 +110,6 @@ EditorStyling.prototype = { ...@@ -114,7 +110,6 @@ EditorStyling.prototype = {
node.removeClass(classname).setStyles(styles); node.removeClass(classname).setStyles(styles);
}, this); }, this);
this.setSelection(originalSelection);
}, },
/** /**
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment