Browse Source

Add the possibility to select parent component

pull/330/head
Artur Arseniev 9 years ago
parent
commit
f0e73a868a
  1. 20
      index.html
  2. 2
      src/commands/index.js
  3. 9
      src/commands/view/SelectParent.js
  4. 6
      src/dom_components/model/Component.js

20
index.html

@ -1037,15 +1037,7 @@
sectors: [{
name: 'General',
open: false,
buildProps: ['opacity', 'float', 'display', 'position', 'top', 'right', 'left', 'bottom'],
properties: [{
type: 'slider',
property: 'opacity',
defaults: 1,
step: 0.01,
max: 1,
min:0,
}]
buildProps: ['float', 'display', 'position', 'top', 'right', 'left', 'bottom']
},{
name: 'Dimension',
open: false,
@ -1070,7 +1062,15 @@
},{
name: 'Extra',
open: false,
buildProps: ['transition', 'perspective', 'transform'],
buildProps: ['opacity', 'transition', 'perspective', 'transform'],
properties: [{
type: 'slider',
property: 'opacity',
defaults: 1,
step: 0.01,
max: 1,
min:0,
}]
},{
name: 'Flex',
open: false,

2
src/commands/index.js

@ -100,6 +100,7 @@ module.exports = () => {
defaultCommands['open-blocks'] = require('./view/OpenBlocks');
defaultCommands['open-assets'] = require('./view/OpenAssets');
defaultCommands['show-offset'] = require('./view/ShowOffset');
defaultCommands['select-parent'] = require('./view/SelectParent');
defaultCommands.fullscreen = require('./view/Fullscreen');
defaultCommands.preview = require('./view/Preview');
defaultCommands.resize = require('./view/Resize');
@ -117,7 +118,6 @@ module.exports = () => {
ed.select(null);
sel.destroy();
ed.trigger('change:canvasOffset');
//ed.refresh();//change:canvasOffset
},
};

9
src/commands/view/SelectParent.js

@ -0,0 +1,9 @@
module.exports = {
run(editor) {
const comp = editor.getSelected();
const coll = comp && comp.collection;
coll && coll.parent && editor.select(coll.parent);
}
};

6
src/dom_components/model/Component.js

@ -190,6 +190,12 @@ module.exports = Backbone.Model.extend(Styleable).extend({
var model = this;
if(!model.get('toolbar')) {
var tb = [];
if(model.collection) {
tb.push({
attributes: {class: 'fa fa-arrow-up'},
command: 'select-parent',
});
}
if(model.get('draggable')) {
tb.push({
attributes: {class: 'fa fa-arrows'},

Loading…
Cancel
Save