Browse Source

Update JSDocs

pull/36/head
Artur Arseniev 10 years ago
parent
commit
17e2932fb7
  1. 11
      src/asset_manager/model/Asset.js
  2. 3
      src/asset_manager/model/AssetImage.js
  3. 3
      src/asset_manager/model/Assets.js
  4. 15
      src/asset_manager/view/AssetImageView.js
  5. 10
      src/asset_manager/view/AssetsView.js
  6. 10
      src/asset_manager/view/FileUploader.js
  7. 23
      src/block_manager/main.js
  8. 8
      src/css_composer/main.js
  9. 5
      src/css_composer/model/CssRule.js
  10. 3
      src/css_composer/model/CssRules.js
  11. 4
      src/css_composer/model/Selectors.js
  12. 8
      src/css_composer/view/CssRuleView.js
  13. 6
      src/css_composer/view/CssRulesView.js
  14. 14
      src/modal_dialog/main.js
  15. 48
      src/selector_manager/main.js
  16. 2
      src/selector_manager/model/Selector.js
  17. 11
      src/selector_manager/view/ClassTagView.js
  18. 20
      src/selector_manager/view/ClassTagsView.js

11
src/asset_manager/model/Asset.js

@ -1,8 +1,5 @@
define(['backbone'], define(['backbone'],
function (Backbone) { function (Backbone) {
/**
* @class Asset
* */
return Backbone.Model.extend({ return Backbone.Model.extend({
idAttribute: 'src', idAttribute: 'src',
@ -14,8 +11,8 @@ define(['backbone'],
/** /**
* Get filename of the asset * Get filename of the asset
* * @return {string}
* @return {String} * @private
* */ * */
getFilename: function(){ getFilename: function(){
return this.get('src').split('/').pop(); return this.get('src').split('/').pop();
@ -23,8 +20,8 @@ define(['backbone'],
/** /**
* Get extension of the asset * Get extension of the asset
* * @return {string}
* @return {String} * @private
* */ * */
getExtension: function(){ getExtension: function(){
return this.getFilename().split('.').pop(); return this.getFilename().split('.').pop();

3
src/asset_manager/model/AssetImage.js

@ -1,8 +1,5 @@
define(['backbone', './Asset'], define(['backbone', './Asset'],
function (Backbone, Asset) { function (Backbone, Asset) {
/**
* @class AssetImage
* */
return Asset.extend({ return Asset.extend({
defaults: _.extend({}, Asset.prototype.defaults, { defaults: _.extend({}, Asset.prototype.defaults, {

3
src/asset_manager/model/Assets.js

@ -1,8 +1,5 @@
define(['backbone', './Asset', './AssetImage'], define(['backbone', './Asset', './AssetImage'],
function (Backbone, Asset, AssetImage) { function (Backbone, Asset, AssetImage) {
/**
* @class Assets
* */
return Backbone.Collection.extend({ return Backbone.Collection.extend({
model: AssetImage, model: AssetImage,

15
src/asset_manager/view/AssetImageView.js

@ -1,8 +1,5 @@
define(['./AssetView','text!./../template/assetImage.html'], define(['./AssetView','text!./../template/assetImage.html'],
function (AssetView, assetTemplate) { function (AssetView, assetTemplate) {
/**
* @class AssetImageView
* */
return AssetView.extend({ return AssetView.extend({
events:{ events:{
@ -21,8 +18,7 @@ define(['./AssetView','text!./../template/assetImage.html'],
/** /**
* Trigger when asset is been selected * Trigger when asset is been selected
* * @private
* @return void
* */ * */
selected: function(){ selected: function(){
this.model.collection.trigger('deselectAll'); this.model.collection.trigger('deselectAll');
@ -33,8 +29,7 @@ define(['./AssetView','text!./../template/assetImage.html'],
/** /**
* Trigger when asset is been chosen (double clicked) * Trigger when asset is been chosen (double clicked)
* * @private
* @return void
* */ * */
chosen: function(){ chosen: function(){
this.updateTarget(this.model.get('src')); this.updateTarget(this.model.get('src'));
@ -47,8 +42,7 @@ define(['./AssetView','text!./../template/assetImage.html'],
/** /**
* Update target if exists * Update target if exists
* @param {String} v Value * @param {String} v Value
* * @private
* @return void
* */ * */
updateTarget: function(v){ updateTarget: function(v){
var target = this.model.collection.target; var target = this.model.collection.target;
@ -61,8 +55,7 @@ define(['./AssetView','text!./../template/assetImage.html'],
/** /**
* Remove asset from collection * Remove asset from collection
* * @private
* @return void
* */ * */
removeItem: function(e){ removeItem: function(e){
e.stopPropagation(); e.stopPropagation();

10
src/asset_manager/view/AssetsView.js

@ -1,8 +1,5 @@
define(['backbone', './AssetView', './AssetImageView', './FileUploader', 'text!./../template/assets.html'], define(['backbone', './AssetView', './AssetImageView', './FileUploader', 'text!./../template/assets.html'],
function (Backbone, AssetView, AssetImageView, FileUploader, assetsTemplate) { function (Backbone, AssetView, AssetImageView, FileUploader, assetsTemplate) {
/**
* @class AssetsView
* */
return Backbone.View.extend({ return Backbone.View.extend({
template: _.template(assetsTemplate), template: _.template(assetsTemplate),
@ -25,6 +22,7 @@ define(['backbone', './AssetView', './AssetImageView', './FileUploader', 'text!.
* Add new asset to the collection via string * Add new asset to the collection via string
* @param {Event} e Event object * @param {Event} e Event object
* @return {this} * @return {this}
* @private
*/ */
addFromStr: function(e){ addFromStr: function(e){
e.preventDefault(); e.preventDefault();
@ -67,6 +65,7 @@ define(['backbone', './AssetView', './AssetImageView', './FileUploader', 'text!.
/** /**
* Add asset to collection * Add asset to collection
* @private
* */ * */
addToAsset: function(model){ addToAsset: function(model){
this.addAsset(model); this.addAsset(model);
@ -76,8 +75,8 @@ define(['backbone', './AssetView', './AssetImageView', './FileUploader', 'text!.
* Add new asset to collection * Add new asset to collection
* @param Object Model * @param Object Model
* @param Object Fragment collection * @param Object Fragment collection
*
* @return Object Object created * @return Object Object created
* @private
* */ * */
addAsset: function(model, fragmentEl){ addAsset: function(model, fragmentEl){
var fragment = fragmentEl || null; var fragment = fragmentEl || null;
@ -105,8 +104,7 @@ define(['backbone', './AssetView', './AssetImageView', './FileUploader', 'text!.
/** /**
* Deselect all assets * Deselect all assets
* * @private
* @return void
* */ * */
deselectAll: function(){ deselectAll: function(){
this.$el.find('.' + this.pfx + 'highlight').removeClass(this.pfx + 'highlight'); this.$el.find('.' + this.pfx + 'highlight').removeClass(this.pfx + 'highlight');

10
src/asset_manager/view/FileUploader.js

@ -1,9 +1,5 @@
define(['backbone', 'text!./../template/fileUploader.html'], define(['backbone', 'text!./../template/fileUploader.html'],
function (Backbone, fileUploaderTemplate) { function (Backbone, fileUploaderTemplate) {
/**
* @class FileUploader
* */
return Backbone.View.extend({ return Backbone.View.extend({
template: _.template(fileUploaderTemplate), template: _.template(fileUploaderTemplate),
@ -24,8 +20,7 @@ define(['backbone', 'text!./../template/fileUploader.html'],
/** /**
* Upload files * Upload files
* @param {Object} e Event * @param {Object} e Event
* * @private
* @return void
* */ * */
uploadFile : function(e){ uploadFile : function(e){
var files = e.dataTransfer ? e.dataTransfer.files : e.target.files, var files = e.dataTransfer ? e.dataTransfer.files : e.target.files,
@ -60,8 +55,7 @@ define(['backbone', 'text!./../template/fileUploader.html'],
/** /**
* Make input file droppable * Make input file droppable
* * @private
* @return void
* */ * */
initDrop: function(){ initDrop: function(){
var that = this; var that = this;

23
src/block_manager/main.js

@ -1,5 +1,4 @@
/** /**
* * [init](#init)
* * [add](#add) * * [add](#add)
* * [get](#get) * * [get](#get)
* * [getAll](#getall) * * [getAll](#getall)
@ -14,6 +13,17 @@
* ``` * ```
* *
* @module BlockManager * @module BlockManager
* @param {Object} config Configurations
* @param {Array<Object>} [config.blocks=[]] Default blocks
* @example
* ...
* {
* blocks: [
* {id:'h1-block' label: 'Heading', content:'<h1>...</h1>'},
* ...
* ],
* }
* ...
*/ */
define(function(require) { define(function(require) {
@ -36,17 +46,8 @@ define(function(require) {
/** /**
* Initialize module. Automatically called with a new instance of the editor * Initialize module. Automatically called with a new instance of the editor
* @param {Object} config Configurations * @param {Object} config Configurations
* @param {Array<Object>} [config.blocks=[]] Default blocks
* @return {this} * @return {this}
* @example * @private
* ...
* {
* blocks: [
* {id:'h1-block' label: 'Heading', content:'<h1>...</h1>'},
* ...
* ],
* }
* ...
*/ */
init: function(config) { init: function(config) {
c = config || {}; c = config || {};

8
src/css_composer/main.js

@ -6,7 +6,7 @@
* * [store](#store) * * [store](#store)
* *
* This module contains and manage CSS rules for the template inside the canvas * This module contains and manage CSS rules for the template inside the canvas
* Before using methods you should get first the module from the editor instance, in this way: * Before using the methods you should get first the module from the editor instance, in this way:
* *
* ```js * ```js
* var cssComposer = editor.CssComposer; * var cssComposer = editor.CssComposer;
@ -59,7 +59,7 @@ define(function(require) {
}, },
/** /**
* Initialize module. Automatically called with a new instance of the editor * Initializes module. Automatically called with a new instance of the editor
* @param {Object} config Configurations * @param {Object} config Configurations
* @private * @private
*/ */
@ -177,7 +177,7 @@ define(function(require) {
}, },
/** /**
* Get rule * Get the rule
* @param {Array<Selector>} selectors Array of selectors * @param {Array<Selector>} selectors Array of selectors
* @param {String} state Css rule state * @param {String} state Css rule state
* @param {String} width For which device this style is oriented * @param {String} width For which device this style is oriented
@ -213,7 +213,7 @@ define(function(require) {
}, },
/** /**
* Render block of CSS rules * Render the block of CSS rules
* @return {HTMLElement} * @return {HTMLElement}
* @private * @private
*/ */

5
src/css_composer/model/CssRule.js

@ -1,8 +1,5 @@
define(['backbone', './Selectors'], define(['backbone', './Selectors'],
function (Backbone, Selectors) { function (Backbone, Selectors) {
/**
* @class CssRule
* */
return Backbone.Model.extend({ return Backbone.Model.extend({
defaults: { defaults: {
@ -38,8 +35,8 @@ define(['backbone', './Selectors'],
* @param {Object} selectors Collection of selectors * @param {Object} selectors Collection of selectors
* @param {String} state Css rule state * @param {String} state Css rule state
* @param {String} width For which device this style is oriented * @param {String} width For which device this style is oriented
*
* @return {Boolean} * @return {Boolean}
* @private
*/ */
compare: function(selectors, state, width){ compare: function(selectors, state, width){
var st = state || ''; var st = state || '';

3
src/css_composer/model/CssRules.js

@ -1,8 +1,5 @@
define(['backbone','./CssRule'], define(['backbone','./CssRule'],
function (Backbone, CssRule) { function (Backbone, CssRule) {
/**
* @class CssRules
* */
return Backbone.Collection.extend({ return Backbone.Collection.extend({
initialize: function(models, opt){ initialize: function(models, opt){

4
src/css_composer/model/Selectors.js

@ -1,9 +1,5 @@
define([ 'backbone', 'require'], define([ 'backbone', 'require'],
function (Backbone, require) { function (Backbone, require) {
/**
* @class Selectors
* */
return Backbone.Collection.extend({ return Backbone.Collection.extend({
initialize: function(models, opt){ initialize: function(models, opt){

8
src/css_composer/view/CssRuleView.js

@ -1,8 +1,5 @@
define(['backbone'], define(['backbone'],
function (Backbone) { function (Backbone) {
/**
* @class CssRuleView
* */
return Backbone.View.extend({ return Backbone.View.extend({
tagName: 'style', tagName: 'style',
@ -18,6 +15,7 @@ define(['backbone'],
/** /**
* Triggered when some selector is changed * Triggered when some selector is changed
* @private
*/ */
selChanged: function(){ selChanged: function(){
this.selStr = this.renderSelectors(); this.selStr = this.renderSelectors();
@ -26,8 +24,8 @@ define(['backbone'],
/** /**
* Returns string of selectors * Returns string of selectors
*
* @return {String} * @return {String}
* @private
*/ */
renderSelectors: function(){ renderSelectors: function(){
var sel = []; var sel = [];
@ -39,8 +37,8 @@ define(['backbone'],
/** /**
* Returns string of properties * Returns string of properties
*
* @return {String} * @return {String}
* @private
*/ */
renderProperties: function(){ renderProperties: function(){
var sel = [], var sel = [],

6
src/css_composer/view/CssRulesView.js

@ -1,8 +1,5 @@
define(['backbone','./CssRuleView'], define(['backbone','./CssRuleView'],
function (Backbone, CssRuleView) { function (Backbone, CssRuleView) {
/**
* @class CssRulesView
* */
return Backbone.View.extend({ return Backbone.View.extend({
initialize: function(o) { initialize: function(o) {
@ -16,6 +13,7 @@ define(['backbone','./CssRuleView'],
/** /**
* Add to collection * Add to collection
* @param {Object} model * @param {Object} model
* @private
* */ * */
addTo: function(model){ addTo: function(model){
//console.log('Added'); //console.log('Added');
@ -26,8 +24,8 @@ define(['backbone','./CssRuleView'],
* Add new object to collection * Add new object to collection
* @param {Object} model * @param {Object} model
* @param {Object} fragmentEl * @param {Object} fragmentEl
*
* @return {Object} * @return {Object}
* @private
* */ * */
addToCollection: function(model, fragmentEl){ addToCollection: function(model, fragmentEl){
var fragment = fragmentEl || null; var fragment = fragmentEl || null;

14
src/modal_dialog/main.js

@ -62,7 +62,7 @@ define(function(require) {
}, },
/** /**
* Open modal window * Open the modal window
* @return {this} * @return {this}
*/ */
open: function(){ open: function(){
@ -71,7 +71,7 @@ define(function(require) {
}, },
/** /**
* Close modal window * Close the modal window
* @return {this} * @return {this}
*/ */
close: function(){ close: function(){
@ -80,7 +80,7 @@ define(function(require) {
}, },
/** /**
* Checks if modal window is open * Checks if the modal window is open
* @return {Boolean} * @return {Boolean}
*/ */
isOpen: function(){ isOpen: function(){
@ -88,7 +88,7 @@ define(function(require) {
}, },
/** /**
* Set title to the modal window * Set the title to the modal window
* @param {string} title Title * @param {string} title Title
* @return {this} * @return {this}
* @example * @example
@ -100,7 +100,7 @@ define(function(require) {
}, },
/** /**
* Returns title of the modal window * Returns the title of the modal window
* @return {string} * @return {string}
*/ */
getTitle: function(){ getTitle: function(){
@ -108,7 +108,7 @@ define(function(require) {
}, },
/** /**
* Set content of the modal window * Set the content of the modal window
* @param {string|HTMLElement} content Content * @param {string|HTMLElement} content Content
* @return {this} * @return {this}
* @example * @example
@ -120,7 +120,7 @@ define(function(require) {
}, },
/** /**
* Get content of the modal window * Get the content of the modal window
* @return {string} * @return {string}
*/ */
getContent: function(){ getContent: function(){

48
src/selector_manager/main.js

@ -1,9 +1,7 @@
/** /**
* * [init](#init)
* * [add](#add) * * [add](#add)
* * [get](#get) * * [get](#get)
* * [getAll](#getall) * * [getAll](#getall)
* * [render](#render)
* *
* Selectors in GrapesJS are used in CSS Composer inside Rules and in Components as classes. To get better this concept let's take * Selectors in GrapesJS are used in CSS Composer inside Rules and in Components as classes. To get better this concept let's take
* a look at this code: * a look at this code:
@ -33,6 +31,26 @@
* ``` * ```
* *
* @module SelectorManager * @module SelectorManager
* @param {Object} config Configurations
* @param {Array<Object>} [config.selectors=[]] Default selectors
* @param {Array<Object>} [config.states=[]] Default states
* @param {String} [config.label='Classes'] Classes label
* @param {String} [config.statesLabel='- State -'] The empty state label
* @return {this}
* @example
* ...
* {
* selectors: [
* {name:'myselector1'},
* ...
* ],
* states: [{
* name: 'hover', label: 'Hover'
* },{
* name: 'active', label: 'Click'
* }],
* statesLabel: '- Selecte State -',
* }
*/ */
define(function(require) { define(function(require) {
@ -55,25 +73,8 @@ define(function(require) {
/** /**
* Initialize module. Automatically called with a new instance of the editor * Initialize module. Automatically called with a new instance of the editor
* @param {Object} config Configurations * @param {Object} config Configurations
* @param {Array<Object>} [config.selectors=[]] Default selectors
* @param {Array<Object>} [config.states=[]] Default states
* @param {String} [config.label='Classes'] Classes label
* @param {String} [config.statesLabel='- State -'] The empty state label
* @return {this} * @return {this}
* @example * @private
* ...
* {
* selectors: [
* {name:'myselector1'},
* ...
* ],
* states: [{
* name: 'hover', label: 'Hover'
* },{
* name: 'active', label: 'Click'
* }],
* statesLabel: '- Selecte State -',
* }
*/ */
init: function(conf) { init: function(conf) {
c = conf || {}; c = conf || {};
@ -96,7 +97,7 @@ define(function(require) {
}, },
/** /**
* Add new selector to collection if it's not already exists. Class type is a default one * Add the new selector to collection if it's not already exists. Class type is a default one
* @param {String} name Selector name * @param {String} name Selector name
* @param {Object} opts Selector options * @param {Object} opts Selector options
* @param {String} [opts.label=''] Label for the selector, if it's not provided the label will be the same as the name * @param {String} [opts.label=''] Label for the selector, if it's not provided the label will be the same as the name
@ -117,7 +118,7 @@ define(function(require) {
}, },
/** /**
* Get selector by its name * Get the selector by its name
* @param {String} name Selector name * @param {String} name Selector name
* @return {Model|null} * @return {Model|null}
* @example * @example
@ -129,7 +130,7 @@ define(function(require) {
/** /**
* Get all selectors * Get all selectors
* @return {Collection} * @return {Collection}
* */ * */
getAll: function() { getAll: function() {
return selectors; return selectors;
@ -139,6 +140,7 @@ define(function(require) {
* Render class selectors. If an array of selectors is provided a new instance of the collection will be rendered * Render class selectors. If an array of selectors is provided a new instance of the collection will be rendered
* @param {Array<Object>} selectors * @param {Array<Object>} selectors
* @return {HTMLElement} * @return {HTMLElement}
* @private
*/ */
render: function(selectors) { render: function(selectors) {
if(selectors){ if(selectors){

2
src/selector_manager/model/Selector.js

@ -21,8 +21,8 @@ define(['backbone'],
/** /**
* Escape string * Escape string
* @param {string} name * @param {string} name
*
* @return {string} * @return {string}
* @private
*/ */
escapeName: function(name) { escapeName: function(name) {
return name.toLowerCase().replace(/([^a-z0-9\w]+)/gi, '-'); return name.toLowerCase().replace(/([^a-z0-9\w]+)/gi, '-');

11
src/selector_manager/view/ClassTagView.js

@ -1,8 +1,5 @@
define(['backbone', 'text!./../template/classTag.html'], define(['backbone', 'text!./../template/classTag.html'],
function (Backbone, tagTemplate) { function (Backbone, tagTemplate) {
/**
* @class ClassTagView
* */
return Backbone.View.extend({ return Backbone.View.extend({
template: _.template(tagTemplate), template: _.template(tagTemplate),
@ -32,6 +29,7 @@ define(['backbone', 'text!./../template/classTag.html'],
/** /**
* Start editing tag * Start editing tag
* @private
*/ */
startEditTag: function(){ startEditTag: function(){
this.$labelInput.prop(this.inputProp, false); this.$labelInput.prop(this.inputProp, false);
@ -40,6 +38,7 @@ define(['backbone', 'text!./../template/classTag.html'],
/** /**
* End editing tag. If the class typed already exists the * End editing tag. If the class typed already exists the
* old one will be restored otherwise will be changed * old one will be restored otherwise will be changed
* @private
*/ */
endEditTag: function(){ endEditTag: function(){
var value = this.$labelInput.val(); var value = this.$labelInput.val();
@ -60,6 +59,7 @@ define(['backbone', 'text!./../template/classTag.html'],
/** /**
* Update status of the tag * Update status of the tag
* @private
*/ */
changeStatus: function(){ changeStatus: function(){
this.model.set('active', !this.model.get('active')); this.model.set('active', !this.model.get('active'));
@ -69,6 +69,7 @@ define(['backbone', 'text!./../template/classTag.html'],
/** /**
* Remove tag from the selected component * Remove tag from the selected component
* @param {Object} e * @param {Object} e
* @private
*/ */
removeTag: function(e){ removeTag: function(e){
var comp = this.target.get('selectedComponent'); var comp = this.target.get('selectedComponent');
@ -86,6 +87,7 @@ define(['backbone', 'text!./../template/classTag.html'],
/** /**
* Update status of the checkbox * Update status of the checkbox
* @private
*/ */
updateStatus: function(){ updateStatus: function(){
if(!this.$chk) if(!this.$chk)
@ -102,6 +104,7 @@ define(['backbone', 'text!./../template/classTag.html'],
/** /**
* Update label's input * Update label's input
* @private
*/ */
updateInputLabel: function(){ updateInputLabel: function(){
if(!this.$labelInput) if(!this.$labelInput)
@ -111,7 +114,7 @@ define(['backbone', 'text!./../template/classTag.html'],
this.$labelInput.attr('size', size); this.$labelInput.attr('size', size);
}, },
/** @inheritdoc */
render : function(){ render : function(){
this.$el.html( this.template({ this.$el.html( this.template({
label: this.model.get('label'), label: this.model.get('label'),

20
src/selector_manager/view/ClassTagsView.js

@ -1,8 +1,5 @@
define(['backbone', 'text!./../template/classTags.html', './ClassTagView'], define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
function (Backbone, tagsTemplate, ClassTagView) { function (Backbone, tagsTemplate, ClassTagView) {
/**
* @class ClassTagsView
* */
return Backbone.View.extend({ return Backbone.View.extend({
template: _.template(tagsTemplate), template: _.template(tagsTemplate),
@ -39,6 +36,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* Triggered when a tag is removed from collection * Triggered when a tag is removed from collection
* @param {Object} model Removed model * @param {Object} model Removed model
* @private
*/ */
tagRemoved: function(model){ tagRemoved: function(model){
this.updateStateVis(); this.updateStateVis();
@ -47,6 +45,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* Create select input with states * Create select input with states
* @return {string} String of options * @return {string} String of options
* @private
*/ */
getStateOptions: function(){ getStateOptions: function(){
var strInput = ''; var strInput = '';
@ -59,6 +58,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* Add new model * Add new model
* @param {Object} model * @param {Object} model
* @private
*/ */
addNew: function(model){ addNew: function(model){
this.addToClasses(model); this.addToClasses(model);
@ -67,7 +67,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* Start tag creation * Start tag creation
* @param {Object} e * @param {Object} e
* * @private
*/ */
startNewTag: function(e) { startNewTag: function(e) {
this.$addBtn.hide(); this.$addBtn.hide();
@ -77,7 +77,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* End tag creation * End tag creation
* @param {Object} e * @param {Object} e
* * @private
*/ */
endNewTag: function(e) { endNewTag: function(e) {
this.$addBtn.show(); this.$addBtn.show();
@ -87,6 +87,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* Checks what to do on keyup event * Checks what to do on keyup event
* @param {Object} e * @param {Object} e
* @private
*/ */
onInputKeyUp: function(e) { onInputKeyUp: function(e) {
if (e.keyCode === 13) if (e.keyCode === 13)
@ -98,6 +99,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* Triggered when component is changed * Triggered when component is changed
* @param {Object} e * @param {Object} e
* @private
*/ */
componentChanged: function(e){ componentChanged: function(e){
this.compTarget = this.target.get('selectedComponent'); this.compTarget = this.target.get('selectedComponent');
@ -111,6 +113,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* Update states visibility. Hides states in case there is no tags * Update states visibility. Hides states in case there is no tags
* inside collection * inside collection
* @private
*/ */
updateStateVis: function(){ updateStateVis: function(){
if(this.collection.length) if(this.collection.length)
@ -145,6 +148,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* Triggered when the select with states is changed * Triggered when the select with states is changed
* @param {Object} e * @param {Object} e
* @private
*/ */
stateChanged: function(e){ stateChanged: function(e){
if(this.compTarget){ if(this.compTarget){
@ -158,6 +162,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* Add new tag to collection, if possible, and to the component * Add new tag to collection, if possible, and to the component
* @param {Object} e * @param {Object} e
* @private
*/ */
addNewTag: function(name){ addNewTag: function(name){
if(!name) if(!name)
@ -187,8 +192,8 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
* Add new object to collection * Add new object to collection
* @param {Object} model Model * @param {Object} model Model
* @param {Object} fragmentEl Fragment collection * @param {Object} fragmentEl Fragment collection
*
* @return {Object} Object created * @return {Object} Object created
* @private
* */ * */
addToClasses: function(model, fragmentEl) { addToClasses: function(model, fragmentEl) {
var fragment = fragmentEl || null; var fragment = fragmentEl || null;
@ -211,6 +216,7 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
/** /**
* Render the collection of classes * Render the collection of classes
* @return {this} * @return {this}
* @private
*/ */
renderClasses: function() { renderClasses: function() {
var fragment = document.createDocumentFragment(); var fragment = document.createDocumentFragment();
@ -258,8 +264,6 @@ define(['backbone', 'text!./../template/classTags.html', './ClassTagView'],
return this.$statesC; return this.$statesC;
}, },
/** @inheritdoc */
render : function(){ render : function(){
this.$el.html( this.template({ this.$el.html( this.template({
label: this.config.label, label: this.config.label,

Loading…
Cancel
Save