Skip to content

Commit

Permalink
Merge branch 't/13254'
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed May 8, 2015
2 parents 53c2dc1 + 9e5432a commit d63c062
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGES.md
Expand Up @@ -6,6 +6,7 @@ CKEditor 4 Changelog
Fixed Issues:

* [#12899](http://dev.ckeditor.com/ticket/12899): Fixed: Corrected wrong tag ending for horizontal box definition in the [Dialog User Interface](http://ckeditor.com/addon/dialogui) plugin. Thanks to [mizafish](https://github.com/mizafish)!
* [#13254](http://dev.ckeditor.com/ticket/13254): Fixed: Cannot outdent block after indent when using [Divarea](http://ckeditor.com/addon/divarea) plugin. Thanks to [Jonathan Cottrill](https://github.com/jcttrll)!
* [#12796](http://dev.ckeditor.com/ticket/12796): Fixed: The [Indent List](http://ckeditor.com/addon/indentlist) plugin unwraps parent `<li>` elements.
* [#12885](http://dev.ckeditor.com/ticket/12885): Added missing [`editor.getData()`](http://docs.ckeditor.com/#!/api/CKEDITOR.editor-method-getData) parameter documentation.
* [#11982](http://dev.ckeditor.com/ticket/11982): Bullet added in wrong position after the *Enter* key is pressed in a nested list.
Expand Down
4 changes: 3 additions & 1 deletion plugins/indentblock/plugin.js
Expand Up @@ -53,7 +53,9 @@
// Switch context from somewhere inside list item to list item,
// if not found just assign self (doing nothing).
if ( !firstBlock.is( $listItem ) ) {
firstBlock = firstBlock.getAscendant( $listItem ) || firstBlock;
var ascendant = firstBlock.getAscendant( $listItem );

firstBlock = ( ascendant && path.contains( ascendant ) ) || firstBlock;
}

// Switch context from list item to list
Expand Down
7 changes: 7 additions & 0 deletions tests/tickets/13254/1.html
@@ -0,0 +1,7 @@
<div>
<ul>
<li>
<textarea id="editor">some text</textarea>
</li>
</ul>
</div>
30 changes: 30 additions & 0 deletions tests/tickets/13254/1.js
@@ -0,0 +1,30 @@
/* bender-tags: indent,indentblock */
/* bender-ckeditor-plugins: button,indent,indentblock,divarea */

'use strict';

bender.editor = {
creator: 'replace',
name: 'editor'
};

bender.test( {
'test indenting and outdenting block in divarea plugin container inside li': function() {
var editor = this.editor;
editor.focus();
bender.tools.selection.setWithHtml( editor, '<p>hello{}</p>' );

assert.areSame( 2, editor.getCommand( 'indent' ).state, 'initial indent state' );
assert.areSame( 0, editor.getCommand( 'outdent' ).state, 'initial outdent state' );

editor.execCommand( 'indent' );

assert.areSame( 2, editor.getCommand( 'indent' ).state, 'indent state after indenting' );
assert.areSame( 2, editor.getCommand( 'outdent' ).state, 'outdent state after indenting' );

editor.execCommand( 'outdent' );

assert.areSame( 2, editor.getCommand( 'indent' ).state, 'indent state after outdenting' );
assert.areSame( 0, editor.getCommand( 'outdent' ).state, 'outdent state after outdenting' );
}
} );
13 changes: 13 additions & 0 deletions tests/tickets/13254/2.html
@@ -0,0 +1,13 @@
<div>
<ul>
<li>
<textarea id="editor">some text</textarea>
</li>
</ul>
</div>

<script>
CKEDITOR.replace( 'editor', {
extraPlugins: 'divarea,indentblock,toolbar'
} );
</script>
8 changes: 8 additions & 0 deletions tests/tickets/13254/2.md
@@ -0,0 +1,8 @@
@bender-tags: 4.4.8, tc
@bender-ui: collapsed
@bender-tags: indent,indentblock

1. Indent block.
* Expected: Outdent button is not disabled.
2. Outent block.
* Expected: It worked.

0 comments on commit d63c062

Please sign in to comment.