Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Fixes #63 names added to dom element
- Loading branch information
Showing
with
16 additions
and
2 deletions.
-
+14
−2
framer/Layer.coffee
-
+2
−0
test/tests/LayerTest.coffee
|
@@ -82,8 +82,6 @@ class exports.Layer extends BaseClass |
|
|
############################################################## |
|
|
# Properties |
|
|
|
|
|
@define "name", @simpleProperty "name", "" |
|
|
|
|
|
# Css properties |
|
|
@define "width", layerProperty "width", "width", 100 |
|
|
@define "height", layerProperty "height", "height", 100 |
|
@@ -147,6 +145,20 @@ class exports.Layer extends BaseClass |
|
|
@define "borderWidth", layerStyleProperty "borderWidth" |
|
|
|
|
|
|
|
|
############################################################## |
|
|
# Identity |
|
|
|
|
|
@define "name", |
|
|
exportable: true |
|
|
default: "" |
|
|
get: -> |
|
|
@_getPropertyValue "name" |
|
|
set: (value) -> |
|
|
@_setPropertyValue "name", value |
|
|
# Set the name attribute of the dom element too |
|
|
# See: https://github.com/koenbok/Framer/issues/63 |
|
|
@_element.setAttribute "name", value |
|
|
|
|
|
############################################################## |
|
|
# Geometry |
|
|
|
|
|
|
@@ -139,11 +139,13 @@ describe "Layer", -> |
|
|
it "should set name on create", -> |
|
|
layer = new Layer name:"Test" |
|
|
layer.name.should.equal "Test" |
|
|
layer._element.getAttribute("name").should.equal "Test" |
|
|
|
|
|
it "should set name after create", -> |
|
|
layer = new Layer |
|
|
layer.name = "Test" |
|
|
layer.name.should.equal "Test" |
|
|
layer._element.getAttribute("name").should.equal "Test" |
|
|
|
|
|
# it "should handle background color with image", -> |
|
|
|
|
|