Skip to content
This repository has been archived by the owner on Jun 26, 2020. It is now read-only.

Commit

Permalink
Removed obsolote code from HeadingCommand tests. Docs refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
oleq committed Mar 10, 2017
1 parent 811e3d7 commit 611dcf3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/headingcommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,23 +41,23 @@ export default class HeadingCommand extends Command {

/**
* Unique identifier of the command, also element's name in the model.
* See {@link module:heading/headingcommand~HeadingOption#modelElement}.
* See {@link module:heading/headingcommand~HeadingOption}.
*
* @readonly
* @member {String} #modelElement
*/

/**
* Element this command creates in the view.
* See {@link module:heading/headingcommand~HeadingOption#viewElement}.
* See {@link module:heading/headingcommand~HeadingOption}.
*
* @readonly
* @member {String} #viewElement
*/

/**
* User-readable title of the command.
* See {@link module:heading/headingcommand~HeadingOption#title}.
* See {@link module:heading/headingcommand~HeadingOption}.
*
* @readonly
* @member {String} #title
Expand Down
8 changes: 5 additions & 3 deletions src/headingengine.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ export default class HeadingEngine extends Plugin {
*/
this.commands = new Collection( { idProperty: 'modelElement' } );

// TODO: This needs proper documentation, i.e. why paragraph entry does not need
// more properties (https://github.com/ckeditor/ckeditor5/issues/403).
editor.config.define( 'heading', {
options: [
{ modelElement: 'paragraph' },
Expand Down Expand Up @@ -116,10 +118,10 @@ export default class HeadingEngine extends Plugin {

/**
* Returns heading options as defined in `config.heading.options` but processed to consider
* editor localization, i.e. to display {@link module:heading/headingcommand~HeadingOption#title}
* editor localization, i.e. to display {@link module:heading/headingcommand~HeadingOption}
* in the correct language.
*
* Note: The reason behind this method is that there's no way to use {@link utils/locale~Locale#t}
* Note: The reason behind this method is that there's no way to use {@link module:utils/locale~Locale#t}
* when the user config is defined because the editor does not exist yet.
*
* @private
Expand All @@ -141,7 +143,7 @@ export default class HeadingEngine extends Plugin {

/**
* Cached localized version of `config.heading.options` generated by
* {@link module:heading/headingengine~HeadingEngine#_localizedOptions}.
* {@link module:heading/headingengine~HeadingEngine#_getLocalizedOptions}.
*
* @private
* @readonly
Expand Down
2 changes: 1 addition & 1 deletion tests/headingcommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ describe( 'HeadingCommand', () => {
const command = commands.heading1;

setData( document, '<heading1>foo[]bar</heading1>' );
command._doExecute( { modelElement: 'heading1' } );
command._doExecute();

expect( getData( document ) ).to.equal( '<paragraph>foo[]bar</paragraph>' );
} );
Expand Down

0 comments on commit 611dcf3

Please sign in to comment.