Skip to content
Permalink
Browse files

Merge branch 't/10190' into major

  • Loading branch information...
mlewand committed Mar 26, 2014
2 parents 1292e5f + ebff69d commit c1cc4d2dc1bfef2b2e13d7b1c64b90228d501827
Showing with 20 additions and 2 deletions.
  1. +1 −0 CHANGES.md
  2. +19 −2 core/style.js
@@ -13,6 +13,7 @@ CKEditor 4 Changelog

New Features:

* [#10190](http://dev.ckeditor.com/ticket/10190): Fixed: Removing block style by [`editor.removeStyle`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-removeStyle) should result in paragraph not div.
* [#5217](http://dev.ckeditor.com/ticket/5217): Setting data (including switching between modes) creates new undo snapshot. Besides that:
* Introduced the [`editable.status`](http://docs.ckeditor.com/#!/api/CKEDITOR.editable-property-status) property.
* Introduced new option `forceUpdate` for the [`editor.lockSnapshot`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-event-lockSnapshot) event.
@@ -131,8 +131,15 @@ CKEDITOR.STYLE_OBJECT = 3;
* @param {CKEDITOR.style} style
*/
CKEDITOR.editor.prototype.applyStyle = function( style ) {
if ( style.checkApplicable( this.elementPath() ) )
if ( style.checkApplicable( this.elementPath() ) ) {
var initialEnterMode = style._.enterMode;

// See comment in removeStyle.
if ( !initialEnterMode )
style._.enterMode = this.activeEnterMode;
applyStyleOnSelection.call( style, this.getSelection() );
style._.enterMode = initialEnterMode;
}
};

/**
@@ -142,8 +149,18 @@ CKEDITOR.STYLE_OBJECT = 3;
* @param {CKEDITOR.style} style
*/
CKEDITOR.editor.prototype.removeStyle = function( style ) {
if ( style.checkApplicable( this.elementPath() ) )
if ( style.checkApplicable( this.elementPath() ) ) {
var initialEnterMode = style._.enterMode;

// There's no other way to pass editor's enter mode to the
// styles system and we need to do that (see #10190).
// However, we should not change style's enter mode if it was
// already set, because that could break backward compatibility.
if ( !initialEnterMode )
style._.enterMode = this.activeEnterMode;
applyStyleOnSelection.call( style, this.getSelection(), 1 );
style._.enterMode = initialEnterMode;
}
};

CKEDITOR.style.prototype = {

0 comments on commit c1cc4d2

Please sign in to comment.
You can’t perform that action at this time.