diff --git a/CHANGES.md b/CHANGES.md index ec4e68c5ba2..2655ea98567 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -10,6 +10,7 @@ Fixed Issues: * [#11848](http://dev.ckeditor.com/ticket/11848): Fixed: [`editor.insertElement()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-insertElement) throwing an exception in IE, when there was no selection in editor. * [#11801](http://dev.ckeditor.com/ticket/11801): Fixed: Editor anchors unavailable when linking [Enhanced Image](http://ckeditor.com/addon/image2) widget. * [#11626](http://dev.ckeditor.com/ticket/11626): Fixed: [Table Resize](http://ckeditor.com/addon/tableresize) sets invalid width. +* [#11872](http://dev.ckeditor.com/ticket/11872): Made [`element.addClass()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-addClass) chainable symmetrically to [`element.removeClass()`](http://docs.ckeditor.com/#!/api/CKEDITOR.dom.element-method-removeClass). Other changes: diff --git a/core/dom/element.js b/core/dom/element.js index fabcb89319d..a1c2dd0b4a5 100644 --- a/core/dom/element.js +++ b/core/dom/element.js @@ -134,6 +134,7 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, { * element.addClass( 'classB' ); //
* element.addClass( 'classA' ); //
* + * @chainable * @param {String} className The name of the class to be added. */ addClass: function( className ) { @@ -144,6 +145,8 @@ CKEDITOR.tools.extend( CKEDITOR.dom.element.prototype, { c += ' ' + className; } this.$.className = c || className; + + return this; }, /**