Browse Source

Update configs

pull/36/head
Artur Arseniev 9 years ago
parent
commit
16adb56d93
  1. 1
      src/demo.js
  2. 39
      src/editor/config/config.js
  3. 56
      src/style_manager/config/config.js
  4. 1
      src/style_manager/view/PropertyIntegerView.js
  5. 4
      src/style_manager/view/PropertyView.js

1
src/demo.js

@ -329,5 +329,6 @@ require(['config/require-config'], function() {
window.editor = editor;
});
});

39
src/editor/config/config.js

@ -38,9 +38,6 @@ define(function () {
//Configurations for Canvas
canvas: {},
//Configurations for Style Manager
styleManager: {},
//Configurations for Layers
layers: {},
@ -88,6 +85,42 @@ define(function () {
}],
},
//Configurations for Style Manager
styleManager: {
sectors: [{
name: 'General',
open: false,
buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom'],
},{
name: 'Dimension',
open: false,
buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'],
},{
name: 'Typography',
open: false,
buildProps: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height', 'text-align', 'text-shadow'],
properties: [{
property: 'text-align',
list : [
{value: 'left', className: 'fa fa-align-left'},
{value: 'center', className: 'fa fa-align-center' },
{value: 'right', className: 'fa fa-align-right'},
{value: 'justify', className: 'fa fa-align-justify'}
],
}]
},{
name: 'Decorations',
open: false,
buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'],
},{
name: 'Extra',
open: false,
buildProps: ['transition', 'perspective', 'transform'],
}],
},
//Configurations for Block Manager
blockManager: {
'blocks': [{

56
src/style_manager/config/config.js

@ -1,55 +1,13 @@
define(function () {
return {
stylePrefix: 'sm-',
return {
// Default sectors, which could include also properties
//
// Example:
// sectors: [{
// name: 'Some sector name',
// properties:[{
// name : 'Width',
// property : 'width',
// type : 'integer',
// units : ['px','%'],
// defaults : 'auto',
// min : 0,
// }],
// }]
sectors: [{
name: 'General',
open: false,
buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom'],
},{
name: 'Dimension',
open: false,
buildProps: ['width', 'height', 'max-width', 'min-height', 'margin', 'padding'],
},{
name: 'Typography',
open: false,
buildProps: ['font-family', 'font-size', 'font-weight', 'letter-spacing', 'color', 'line-height', 'text-align', 'text-shadow'],
properties: [{
property: 'text-align',
list : [
{value: 'left', className: 'fa fa-align-left'},
{value: 'center', className: 'fa fa-align-center' },
{value: 'right', className: 'fa fa-align-right'},
{value: 'justify', className: 'fa fa-align-justify'}
],
}]
},{
name: 'Decorations',
open: false,
buildProps: ['border-radius-c', 'background-color', 'border-radius', 'border', 'box-shadow', 'background'],
},{
name: 'Extra',
open: false,
buildProps: ['transition', 'perspective', 'transform'],
}],
stylePrefix: 'sm-',
// Text to show in case no element selected
textNoElement: 'Select an element before using Style Manager',
sectors: [],
// Text to show in case no element selected
textNoElement: 'Select an element before using Style Manager',
};
});
});

1
src/style_manager/view/PropertyIntegerView.js

@ -169,7 +169,6 @@ define(['backbone','./PropertyView', 'text!./../templates/propertyInteger.html']
if(this.$unit)
this.$unit.val(u);
this.model.set({value: v, unit: u,}, {silent: true});
},

4
src/style_manager/view/PropertyView.js

@ -28,6 +28,7 @@ define(['backbone', 'text!./../templates/propertyLabel.html', 'text!./../templat
if(!this.model.get('value'))
this.model.set('value', this.model.get('defaults'));
this.listenTo(this.model, 'destroy remove', this.remove);
this.listenTo( this.propTarget, 'update', this.targetUpdated);
this.listenTo( this.model ,'change:value', this.valueChanged);
this.listenTo( this.model ,'targetUpdated', this.targetUpdated);
@ -58,8 +59,9 @@ define(['backbone', 'text!./../templates/propertyLabel.html', 'text!./../templat
this.selectedComponent = this.propTarget.model;
this.helperComponent = this.propTarget.helper;
if(this.getTarget()){
if(!this.sameValue())
if(!this.sameValue()){
this.renderInputRequest();
}
}
},

Loading…
Cancel
Save