From 6c3a924d17365b5b1d77d9ad6d9412815a8f0491 Mon Sep 17 00:00:00 2001 From: Artur Arseniev Date: Tue, 22 Aug 2017 23:07:24 +0200 Subject: [PATCH] Update few API JSDocs --- src/editor/index.js | 47 ++++++++++++++++++++++++++------------ src/editor/model/Editor.js | 3 +++ src/style_manager/index.js | 15 ++++++------ 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/src/editor/index.js b/src/editor/index.js index ed19c91ff..fc6130ba9 100644 --- a/src/editor/index.js +++ b/src/editor/index.js @@ -31,21 +31,21 @@ * var editor = grapesjs.init({...}); * ``` * - * **Available events** - * component:add - Triggered when a new component is added to the editor, the model is passed as an argument to the callback - * component:update - Triggered when a component is, generally, updated (moved, styled, etc.) - * component:update:{propertyName} - Listen any property change - * component:styleUpdate - Triggered when the style of the component is updated - * component:styleUpdate:{propertyName} - Listen for a specific style property change - * styleManager:change - Triggered on style property change from new selected component, the view of the property is passed as an argument to the callback - * styleManager:change:{propertyName} - As above but for a specific style property - * storage:load - Triggered when something was loaded from the storage, loaded object passed as an argumnet - * storage:store - Triggered when something is stored to the storage, stored object passed as an argumnet - * selector:add - Triggers when a new selector/class is created - * canvasScroll - Triggered when the canvas is scrolled - * run:{commandName} - Triggered when some command is called to run (eg. editor.runCommand('preview')) - * stop:{commandName} - Triggered when some command is called to stop (eg. editor.stopCommand('preview')) - * load - When the editor is loaded + * **Available Events** + * `component:add` - Triggered when a new component is added to the editor, the model is passed as an argument to the callback + * `component:update` - Triggered when a component is, generally, updated (moved, styled, etc.) + * `component:update:{propertyName}` - Listen any property change + * `component:styleUpdate` - Triggered when the style of the component is updated + * `component:styleUpdate:{propertyName}` - Listen for a specific style property change + * `styleManager:change` - Triggered on style property change from new selected component, the view of the property is passed as an argument to the callback + * `styleManager:change:{propertyName}` - As above but for a specific style property + * `storage:load` - Triggered when something was loaded from the storage, loaded object passed as an argumnet + * `storage:store` - Triggered when something is stored to the storage, stored object passed as an argumnet + * `selector:add` - Triggers when a new selector/class is created + * `canvasScroll` - Triggered when the canvas is scrolled + * `run:{commandName}` - Triggered when some command is called to run (eg. editor.runCommand('preview')) + * `stop:{commandName}` - Triggered when some command is called to stop (eg. editor.stopCommand('preview')) + * `load` - When the editor is loaded * * @module Editor * @param {Object} config Configurations @@ -104,16 +104,19 @@ module.exports = config => { /** * @property {DomComponents} + * @private */ DomComponents: em.get('DomComponents'), /** * @property {CssComposer} + * @private */ CssComposer: em.get('CssComposer'), /** * @property {StorageManager} + * @private */ StorageManager: em.get('StorageManager'), @@ -124,71 +127,85 @@ module.exports = config => { /** * @property {BlockManager} + * @private */ BlockManager: em.get('BlockManager'), /** * @property {TraitManager} + * @private */ TraitManager: em.get('TraitManager'), /** * @property {SelectorManager} + * @private */ SelectorManager: em.get('SelectorManager'), /** * @property {CodeManager} + * @private */ CodeManager: em.get('CodeManager'), /** * @property {Commands} + * @private */ Commands: em.get('Commands'), /** * @property {Modal} + * @private */ Modal: em.get('Modal'), /** * @property {Panels} + * @private */ Panels: em.get('Panels'), /** * @property {StyleManager} + * @private */ StyleManager: em.get('StyleManager'), /** * @property {Canvas} + * @private */ Canvas: em.get('Canvas'), /** * @property {UndoManager} + * @private */ UndoManager: em.get('UndoManager'), /** * @property {DeviceManager} + * @private */ DeviceManager: em.get('DeviceManager'), /** * @property {RichTextEditor} + * @private */ RichTextEditor: em.get('rte'), /** * @property {Utils} + * @private */ Utils: em.get('Utils'), /** * @property {Utils} + * @private */ Config: em.get('Config'), diff --git a/src/editor/model/Editor.js b/src/editor/model/Editor.js index 4f04e99ff..a76f6c8bd 100644 --- a/src/editor/model/Editor.js +++ b/src/editor/model/Editor.js @@ -78,6 +78,7 @@ module.exports = Backbone.Model.extend({ /** * Set the alert before unload in case it's requested * and there are unsaved changes + * @private */ updateBeforeUnload() { var changes = this.get('changesCount'); @@ -93,6 +94,7 @@ module.exports = Backbone.Model.extend({ * Load generic module * @param {String} moduleName Module name * @return {this} + * @private */ loadModule(moduleName) { var c = this.config; @@ -512,6 +514,7 @@ module.exports = Backbone.Model.extend({ /** * Returns device model by name * @return {Device|null} + * @private */ getDeviceModel() { var name = this.get('device'); diff --git a/src/style_manager/index.js b/src/style_manager/index.js index 1c1f45768..e54f84011 100644 --- a/src/style_manager/index.js +++ b/src/style_manager/index.js @@ -1,12 +1,13 @@ /** * - * - [addSector](#addsector) - * - [getSector](#getsector) - * - [getSectors](#getsectors) - * - [addProperty](#addproperty) - * - [getProperty](#getproperty) - * - [getProperties](#getproperties) - * - [render](#render) + * * [addSector](#addsector) + * * [getSector](#getsector) + * * [getSectors](#getsectors) + * * [addProperty](#addproperty) + * * [getProperty](#getproperty) + * * [getProperties](#getproperties) + * * [getModelToStyle](#getmodeltostyle) + * * [render](#render) * * With Style Manager you basically build categories (called sectors) of CSS properties which could * be used to custom components and classes.