Skip to content

Commit

Permalink
Merge branch 't/12112' into major
Browse files Browse the repository at this point in the history
  • Loading branch information
Reinmar committed Jun 26, 2014
2 parents 1347d37 + 9d9997c commit 34467c6
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 10 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ CKEditor 4 Changelog

## CKEditor 4.5

New Features:

* [#10931](http://dev.ckeditor.com/ticket/10931): Introduce ability to insert widgets into another widget's nested editables. Note that unless nested editable's [allowed content](http://docs.ckeditor.com/#!/api/CKEDITOR.plugins.widget.nestedEditable.definition-property-allowedContent) is defined precisely since CKEditor 4.5 some widget buttons may become enabled.

Fixed Issues:

* [#12018](http://dev.ckeditor.com/ticket/12018): [Nested widgets] Fixed and reviewed: Nested widgets garbage collection.
Expand Down
8 changes: 0 additions & 8 deletions plugins/widget/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -1710,14 +1710,6 @@
}
},

refresh: function( editor, path ) {
// Disable widgets' commands inside nested editables -
// check if blockLimit is a nested editable or a descendant of any.
this.setState( getNestedEditable( editor.editable(), path.blockLimit ) ? CKEDITOR.TRISTATE_DISABLED : CKEDITOR.TRISTATE_OFF );
},
// A hack to force command refreshing on context change.
context: 'div',

allowedContent: widgetDef.allowedContent,
requiredContent: widgetDef.requiredContent,
contentForms: widgetDef.contentForms,
Expand Down
6 changes: 4 additions & 2 deletions tests/plugins/widget/nestededitables.js
Original file line number Diff line number Diff line change
Expand Up @@ -1147,7 +1147,9 @@
} );
},

'test widgets\' commands are disabled in nested editable': function() {
// Behaviour has been changed in 4.5 (#12112), so we're leaving this
// test as a validation of this change.
'test widgets\' commands are enabled in nested editable': function() {
var editor = this.editor,
bot = this.editorBot;

Expand All @@ -1172,7 +1174,7 @@
range.collapse( true );
range.select();

assert.areSame( CKEDITOR.TRISTATE_DISABLED, editor.commands.testcommand1.state, 'command is disabled in nested editable' );
assert.areSame( CKEDITOR.TRISTATE_OFF, editor.commands.testcommand1.state, 'command is enabled in nested editable' );
} );
},

Expand Down

0 comments on commit 34467c6

Please sign in to comment.