Skip to content
Permalink
Browse files

fix bugs introduced in refactor

  • Loading branch information
sjmiles committed Dec 12, 2014
1 parent 69ac515 commit 39ab504dcdd8e45dc8290279af403aa9c608c32a
Showing with 23 additions and 17 deletions.
  1. +5 −4 polymer.html
  2. +2 −5 src/bind/bind-effects.html
  3. +10 −2 src/bind/bind.html
  4. +2 −2 src/features/standard/attributes.html
  5. +4 −4 src/features/standard/events.html
@@ -32,6 +32,7 @@
_standardRegister: function() {
this._simplexRegister();
this._bootBind();
this._bootPublished();
this._bootAnnotations();
this._bootBindEffects();
},
@@ -49,10 +50,10 @@
}
this._setupInstanceBindings();
this._setupBindListeners();
this.takeAttributes();
this.installHostAttributes();
this.listenListeners();
this.listenKeyPresses();
this._takeAttributes();
this._installHostAttributes();
this._listenListeners();
this._listenKeyPresses();
}

});
@@ -26,6 +26,7 @@
};

Bind.addBuilders({

method: function(model, source, effect) {
// TODO(sjmiles): validation system requires a blessed
// validator effect which needs to be processed first.
@@ -65,11 +66,7 @@
// textContent never flows-up
} else {
// flow-up
model._bindListeners.push({
id: id,
property: property,
path: hostProperty
});
_Bind._addBindListener(model, id, property, hostProperty);
}
//
// flow-down
@@ -24,7 +24,7 @@
//console.log('[_setupBindListener]: [%s][%s] listening for [%s][%s-changed]', this.localName, info.path, info.id || info.index, info.property);
var fn = new Function('e', 'this.' + info.path + ' = e.detail.value;');
var node = info.id ? inst.$[info.id] : inst._nodes[info.index];
node.addEventListener(info.property + '-changed', fn.bind(this));
node.addEventListener(info.property + '-changed', fn.bind(inst));
});
},

@@ -163,6 +163,14 @@
});
},

_addBindListener: function(model, id, property, path) {
model._bindListeners.push({
id: id,
property: property,
path: path
});
}
/*
_bindAnnotationProperty: function(name, path, index) {
return 'this._nodes[' + index + '].' + name
+ ' = this._data.' + path + ';';
@@ -175,7 +183,7 @@
path: path
});
}

*/
};

return Bind;
@@ -21,7 +21,7 @@
*
*/

installHostAttributes: function() {
_installHostAttributes: function() {
if (this.hostAttributes) {
this.cloneAttributes(this, this.hostAttributes);
}
@@ -67,7 +67,7 @@
*
*/

takeAttributes: function() {
_takeAttributes: function() {
for (var name in this.published) {
var type = this.getPublishedPropertyType(name);
if (type === Boolean || this.hasAttribute(name)) {
@@ -15,7 +15,7 @@

listeners: {},

listenListeners: function() {
_listenListeners: function() {
var node, name, key;
for (key in this.listeners) {
if (key.indexOf('.') < 0) {
@@ -44,11 +44,11 @@

keyPresses: {},

listenKeyPresses: function() {
_listenKeyPresses: function() {
// for..in here to gate empty keyPresses object (iterates once or never)
for (var n in this.keyPresses) {
// only get here if there is something in keyPresses
this.addEventListener('keydown', this.keyPressesFeatureHandler);
this.addEventListener('keydown', this._keyPressesFeatureHandler);
// map string keys to numeric codes
for (n in this.keyPresses) {
if (typeof n === 'string') {
@@ -59,7 +59,7 @@
}
},

keyPressesFeatureHandler: function(e) {
_keyPressesFeatureHandler: function(e) {
var method = this.keyPresses[e.keyCode];
if (method && this[method]) {
return this[method](e.keyCode, e);

0 comments on commit 39ab504

Please sign in to comment.
You can’t perform that action at this time.