From 970aff13a4a01cc1f03e5c4bb196c6bb2d2ba94c Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Sat, 18 Jun 2016 14:43:15 +0200 Subject: [PATCH] Update JSDocs --- src/commands/main.js | 15 ++++----------- src/dom_components/main.js | 18 +++++------------- src/panels/main.js | 2 +- 3 files changed, 10 insertions(+), 25 deletions(-) diff --git a/src/commands/main.js b/src/commands/main.js index 31db04f70..7c58cf9a2 100644 --- a/src/commands/main.js +++ b/src/commands/main.js @@ -3,7 +3,6 @@ * * [add](#add) * * [get](#get) * - * This module manages commands which could be called mainly by buttons. * You can init the editor with all necessary commands via configuration * * ```js @@ -23,21 +22,15 @@ * @module Commands * @param {Object} config Configurations * @param {Array} [config.defaults=[]] Array of possible commands - * @param {Boolean} [config.firstCentered=true] If true will center new first-level components - * @param {number} [config.minComponentH=50] Minimum height (in px) for new inserted components - * @param {number} [config.minComponentW=50] Minimum width (in px) for new inserted components * @example * ... * commands: { - * firstCentered: true, - * minComponentH: 100, - * minComponentW: 100, * defaults: [{ * id: 'helloWorld', - * run: function(serviceManager, senderBtn){ + * run: function(editor, sender){ * alert('Hello world!'); * }, - * stop: function(serviceManager, senderBtn){ + * stop: function(editor, sender){ * alert('Stop!'); * }, * }], @@ -101,10 +94,10 @@ define(function(require) { * @return {this} * @example * commands.add('myCommand', { - * run: function(serviceManager, senderBtn){ + * run: function(editor, sender){ * alert('Hello world!'); * }, - * stop: function(serviceManager, senderBtn){ + * stop: function(editor, sender){ * }, * }); * */ diff --git a/src/dom_components/main.js b/src/dom_components/main.js index 2724b879a..77c66f865 100644 --- a/src/dom_components/main.js +++ b/src/dom_components/main.js @@ -12,7 +12,7 @@ * ```js * var editor = grapesjs.init({ * ... - * components: {...} // Check below for the possible properties + * domComponents: {...} // Check below for the possible properties * ... * }); * ``` @@ -21,24 +21,16 @@ * Before using methods you should get first the module from the editor instance, in this way: * * ```js - * var ComponentsService = editor.Components; + * var ComponentsService = editor.DomComponents; * ``` * * @module Components * @param {Object} config Configurations - * @param {Array} [config.defaults=[]] Array of possible components + * @param {string|Array} [config.defaults=[]] HTML string or an array of possible components * @example * ... - * components: { - * defaults: [ - * { - * style: { background: 'red'} - * components:[ - * {style: { background: 'blue'}}, - * {style: { background: 'green'}} - * ] - * } - * ], + * domComponents: { + * defaults: '
Hello world!
', * } * ... */ diff --git a/src/panels/main.js b/src/panels/main.js index 293bd2481..43760fbb2 100644 --- a/src/panels/main.js +++ b/src/panels/main.js @@ -1,7 +1,7 @@ /** * - * * [addButton](#addbutton) * * [addPanel](#addpanel) + * * [addButton](#addbutton) * * [getButton](#getbutton) * * [getPanel](#getpanel) * * [getPanels](#getpanels)