Skip to content

Commit

Permalink
Merge branch 'MDL-51227-m29-master' of https://github.com/dthies/moodle
Browse files Browse the repository at this point in the history
… into MOODLE_29_STABLE
  • Loading branch information
stronk7 committed Sep 30, 2015
2 parents 048a099 + 4287eb3 commit f3acb82
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2341,25 +2341,21 @@ EditorStyling.prototype = {
*/
toggleInlineSelectionClass: function(toggleclasses) {
var classname = toggleclasses.join(" ");
var originalSelection = this.getSelection();
var cssApplier = rangy.createCssClassApplier(classname, {normalize: true});

cssApplier.toggleSelection();

this.setSelection(originalSelection);
},

/**
* Change the formatting for 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.
*/
formatSelectionInlineStyle: function(styles) {
var classname = this.PLACEHOLDER_CLASS;
var originalSelection = this.getSelection();
var cssApplier = rangy.createCssClassApplier(classname, {normalize: true});

cssApplier.applyToSelection();
Expand All @@ -2368,7 +2364,6 @@ EditorStyling.prototype = {
node.removeClass(classname).setStyles(styles);
}, this);

this.setSelection(originalSelection);
},

/**
Expand Down
Loading

0 comments on commit f3acb82

Please sign in to comment.