Browse Source
Merge pull request #562 from ryandeba/selectable-components
add selectable property to component objects
pull/592/head
Artur Arseniev
8 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
7 additions and
0 deletions
-
src/dom_components/model/Component.js
-
src/editor/model/Editor.js
|
|
|
@ -62,6 +62,9 @@ module.exports = Backbone.Model.extend(Styleable).extend({ |
|
|
|
// Hide the component inside Layers
|
|
|
|
layerable: true, |
|
|
|
|
|
|
|
// Allow component to be selected when clicked
|
|
|
|
selectable: true, |
|
|
|
|
|
|
|
// Shows a highlight outline when hovering on the element if true
|
|
|
|
hoverable: true, |
|
|
|
|
|
|
|
|
|
|
|
@ -409,6 +409,10 @@ module.exports = Backbone.Model.extend({ |
|
|
|
model = $(el).data('model'); |
|
|
|
} |
|
|
|
|
|
|
|
if (model && !model.get("selectable")) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
this.set('selectedComponent', model, opts); |
|
|
|
}, |
|
|
|
|
|
|
|
|