Browse Source

Removed obsolote code from HeadingCommand tests. Docs refactoring.

Aleksander Nowodzinski 8 years ago
parent
commit
153ef636e6

+ 3 - 3
packages/ckeditor5-heading/src/headingcommand.js

@@ -41,7 +41,7 @@ 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
@@ -49,7 +49,7 @@ export default class HeadingCommand extends Command {
 
 		/**
 		 * Element this command creates in the view.
-		 * See {@link module:heading/headingcommand~HeadingOption#viewElement}.
+		 * See {@link module:heading/headingcommand~HeadingOption}.
 		 *
 		 * @readonly
 		 * @member {String} #viewElement
@@ -57,7 +57,7 @@ export default class HeadingCommand extends Command {
 
 		/**
 		 * User-readable title of the command.
-		 * See {@link module:heading/headingcommand~HeadingOption#title}.
+		 * See {@link module:heading/headingcommand~HeadingOption}.
 		 *
 		 * @readonly
 		 * @member {String} #title

+ 5 - 3
packages/ckeditor5-heading/src/headingengine.js

@@ -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' },
@@ -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
@@ -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

+ 1 - 1
packages/ckeditor5-heading/tests/headingcommand.js

@@ -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>' );
 			} );