Browse Source

Update few API JSDocs

pull/261/head
Artur Arseniev 9 years ago
parent
commit
6c3a924d17
  1. 47
      src/editor/index.js
  2. 3
      src/editor/model/Editor.js
  3. 15
      src/style_manager/index.js

47
src/editor/index.js

@ -31,21 +31,21 @@
* var editor = grapesjs.init({...}); * var editor = grapesjs.init({...});
* ``` * ```
* *
* **Available events** * **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: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` - Triggered when a component is, generally, updated (moved, styled, etc.)
* component:update:{propertyName} - Listen any property change * `component:update:{propertyName}` - Listen any property change
* component:styleUpdate - Triggered when the style of the component is updated * `component:styleUpdate` - Triggered when the style of the component is updated
* component:styleUpdate:{propertyName} - Listen for a specific style property change * `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` - 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 * `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: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 * `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 * `selector:add` - Triggers when a new selector/class is created
* canvasScroll - Triggered when the canvas is scrolled * `canvasScroll` - Triggered when the canvas is scrolled
* run:{commandName} - Triggered when some command is called to run (eg. editor.runCommand('preview')) * `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')) * `stop:{commandName}` - Triggered when some command is called to stop (eg. editor.stopCommand('preview'))
* load - When the editor is loaded * `load` - When the editor is loaded
* *
* @module Editor * @module Editor
* @param {Object} config Configurations * @param {Object} config Configurations
@ -104,16 +104,19 @@ module.exports = config => {
/** /**
* @property {DomComponents} * @property {DomComponents}
* @private
*/ */
DomComponents: em.get('DomComponents'), DomComponents: em.get('DomComponents'),
/** /**
* @property {CssComposer} * @property {CssComposer}
* @private
*/ */
CssComposer: em.get('CssComposer'), CssComposer: em.get('CssComposer'),
/** /**
* @property {StorageManager} * @property {StorageManager}
* @private
*/ */
StorageManager: em.get('StorageManager'), StorageManager: em.get('StorageManager'),
@ -124,71 +127,85 @@ module.exports = config => {
/** /**
* @property {BlockManager} * @property {BlockManager}
* @private
*/ */
BlockManager: em.get('BlockManager'), BlockManager: em.get('BlockManager'),
/** /**
* @property {TraitManager} * @property {TraitManager}
* @private
*/ */
TraitManager: em.get('TraitManager'), TraitManager: em.get('TraitManager'),
/** /**
* @property {SelectorManager} * @property {SelectorManager}
* @private
*/ */
SelectorManager: em.get('SelectorManager'), SelectorManager: em.get('SelectorManager'),
/** /**
* @property {CodeManager} * @property {CodeManager}
* @private
*/ */
CodeManager: em.get('CodeManager'), CodeManager: em.get('CodeManager'),
/** /**
* @property {Commands} * @property {Commands}
* @private
*/ */
Commands: em.get('Commands'), Commands: em.get('Commands'),
/** /**
* @property {Modal} * @property {Modal}
* @private
*/ */
Modal: em.get('Modal'), Modal: em.get('Modal'),
/** /**
* @property {Panels} * @property {Panels}
* @private
*/ */
Panels: em.get('Panels'), Panels: em.get('Panels'),
/** /**
* @property {StyleManager} * @property {StyleManager}
* @private
*/ */
StyleManager: em.get('StyleManager'), StyleManager: em.get('StyleManager'),
/** /**
* @property {Canvas} * @property {Canvas}
* @private
*/ */
Canvas: em.get('Canvas'), Canvas: em.get('Canvas'),
/** /**
* @property {UndoManager} * @property {UndoManager}
* @private
*/ */
UndoManager: em.get('UndoManager'), UndoManager: em.get('UndoManager'),
/** /**
* @property {DeviceManager} * @property {DeviceManager}
* @private
*/ */
DeviceManager: em.get('DeviceManager'), DeviceManager: em.get('DeviceManager'),
/** /**
* @property {RichTextEditor} * @property {RichTextEditor}
* @private
*/ */
RichTextEditor: em.get('rte'), RichTextEditor: em.get('rte'),
/** /**
* @property {Utils} * @property {Utils}
* @private
*/ */
Utils: em.get('Utils'), Utils: em.get('Utils'),
/** /**
* @property {Utils} * @property {Utils}
* @private
*/ */
Config: em.get('Config'), Config: em.get('Config'),

3
src/editor/model/Editor.js

@ -78,6 +78,7 @@ module.exports = Backbone.Model.extend({
/** /**
* Set the alert before unload in case it's requested * Set the alert before unload in case it's requested
* and there are unsaved changes * and there are unsaved changes
* @private
*/ */
updateBeforeUnload() { updateBeforeUnload() {
var changes = this.get('changesCount'); var changes = this.get('changesCount');
@ -93,6 +94,7 @@ module.exports = Backbone.Model.extend({
* Load generic module * Load generic module
* @param {String} moduleName Module name * @param {String} moduleName Module name
* @return {this} * @return {this}
* @private
*/ */
loadModule(moduleName) { loadModule(moduleName) {
var c = this.config; var c = this.config;
@ -512,6 +514,7 @@ module.exports = Backbone.Model.extend({
/** /**
* Returns device model by name * Returns device model by name
* @return {Device|null} * @return {Device|null}
* @private
*/ */
getDeviceModel() { getDeviceModel() {
var name = this.get('device'); var name = this.get('device');

15
src/style_manager/index.js

@ -1,12 +1,13 @@
/** /**
* *
* - [addSector](#addsector) * * [addSector](#addsector)
* - [getSector](#getsector) * * [getSector](#getsector)
* - [getSectors](#getsectors) * * [getSectors](#getsectors)
* - [addProperty](#addproperty) * * [addProperty](#addproperty)
* - [getProperty](#getproperty) * * [getProperty](#getproperty)
* - [getProperties](#getproperties) * * [getProperties](#getproperties)
* - [render](#render) * * [getModelToStyle](#getmodeltostyle)
* * [render](#render)
* *
* With Style Manager you basically build categories (called sectors) of CSS properties which could * With Style Manager you basically build categories (called sectors) of CSS properties which could
* be used to custom components and classes. * be used to custom components and classes.

Loading…
Cancel
Save