can-stache-bindings
Advanced tools
Comparing version 3.11.2 to 3.11.3
@@ -213,4 +213,6 @@ // # can-stache-bindings.js | ||
// the bindings. | ||
var attributeListener; | ||
if(!bindingsState.isSettingViewModel) { | ||
domEvents.addEventListener.call(el, attributesEventStr, function (ev) { | ||
attributeListener = function (ev) { | ||
var attrName = ev.attributeName, | ||
@@ -247,6 +249,9 @@ value = el.getAttribute(attrName); | ||
} | ||
}); | ||
}; | ||
domEvents.addEventListener.call(el, attributesEventStr, attributeListener); | ||
} | ||
return function() { | ||
domEvents.removeEventListener.call(el, attributesEventStr, attributeListener); | ||
for(var attrName in onTeardowns) { | ||
@@ -299,9 +304,3 @@ onTeardowns[attrName](); | ||
teardown = dataBinding.onTeardown; | ||
canEvent.one.call(el, removedStr, function() { | ||
teardown(); | ||
}); | ||
// Listen for changes | ||
domEvents.addEventListener.call(el, attributesEventStr, function (ev) { | ||
var attributeListener = function (ev) { | ||
var attrName = ev.attributeName, | ||
@@ -335,2 +334,10 @@ value = el.getAttribute(attrName); | ||
} | ||
}; | ||
// Listen for changes | ||
domEvents.addEventListener.call(el, attributesEventStr, attributeListener); | ||
teardown = dataBinding.onTeardown; | ||
canEvent.one.call(el, removedStr, function () { | ||
teardown(); | ||
domEvents.removeEventListener.call(el, attributesEventStr, attributeListener); | ||
}); | ||
@@ -337,0 +344,0 @@ }, |
{ | ||
"name": "can-stache-bindings", | ||
"version": "3.11.2", | ||
"version": "3.11.3", | ||
"description": "Default binding syntaxes for can-stache", | ||
@@ -5,0 +5,0 @@ "homepage": "http://canjs.com", |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
234195
5276