Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Aug 14, 2014
1 parent cbc7473 commit 9907903
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 91 deletions.
83 changes: 1 addition & 82 deletions editors/property-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
-->

<link rel="import" href="editors.html">
<link rel="import" href="specialized-editors.html">

<polymer-element name="property-editor" attributes="editorTag propertyValue value">
<template>
Expand Down Expand Up @@ -145,85 +146,3 @@

</script>
</polymer-element>

<polymer-element name="id-select-editor" extends="select-editor">
<template>
<shadow></shadow>
</template>
<script>

Polymer({
root: null,
idPrefix: '',

metaChanged: function() {
this.super();
this.root = this.findRoot(this.meta.obj);
},

rootChanged: function() {
this.buildOptions();
},

findRoot: function(node) {
while (node && node.id !== 'canvas') {
node = node.parentNode;
}
return node;
},

buildOptions: function() {
var o = [''];
if (this.root) {
var pre = this.idPrefix;
Array.prototype.forEach.call(this.root.querySelectorAll('[id]'),
function(n) {
o.push(pre + n.id);
});
}
this.options = o;
},

get selectedNode() {
return this.root && this.value
&& this.root.querySelector('#' + this.value);
}

});

</script>
</polymer-element>

<polymer-element name="target-select-editor" extends="id-select-editor">
<script>

Polymer({

idPrefix: '#'

});

</script>
</polymer-element>

<polymer-element name="action-editor" extends="abstract-editor">
<template>

<button touch-action="none" on-pointerup="{{buttonClick}}">{{meta.label}}</button>

</template>
<script>

Polymer({

buttonClick: function() {
var action = this.meta.action;
if (this.meta.obj[action]) {
this.meta.obj[action]();
}
}

});

</script>
</polymer-element>
10 changes: 4 additions & 6 deletions editors/specialized-editors.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,11 @@

<polymer-element name="id-select-editor" extends="select-editor">
<template>

<shadow></shadow>

</template>
<script>

Polymer({

root: null,
idPrefix: '',

Expand All @@ -32,7 +29,7 @@
},

findRoot: function(node) {
while (node && node.id !== 'canvas') {
while (node && !node.__designHost) {
node = node.parentNode;
}
return node;
Expand All @@ -54,6 +51,7 @@
return this.root && this.value
&& this.root.querySelector('#' + this.value);
}

});

</script>
Expand Down Expand Up @@ -89,6 +87,6 @@
}

});

</script>
</polymer-element>
</polymer-element>
3 changes: 0 additions & 3 deletions reflection.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ function reflectProperty(element, name, meta) {
if (name[0] === '_' || name[name.length-1] === '_') {
return;
}
if (element.publish && element.publish[name] === undefined) {
return;
}
var v = element[name];
if (((v !== null
&& v !== undefined
Expand Down

0 comments on commit 9907903

Please sign in to comment.