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({...});
* ```
*
* **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'),

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
* 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');

15
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.

Loading…
Cancel
Save