strip listeners

pull/1/head
ansuz 8 years ago
parent b79618c94a
commit 4cd9bd5534

@ -35,8 +35,23 @@ define([
window.Toolbar = Toolbar;
window.Hyperjson = Hyperjson;
var slice = function (coll) {
return Array.prototype.slice.call(coll);
};
var removeListeners = function (root) {
slice(root.attributes).map(function (attr) {
if (/^on/.test(attr.name)) {
root.attributes.removeNamedItem(attr.name);
}
});
slice(root.children).forEach(removeListeners);
};
var hjsonToDom = function (H) {
return Hyperjson.toDOM(H); //callOn(H, Hyperscript);
var dom = Hyperjson.toDOM(H);
removeListeners(dom);
return dom;
};
var module = window.REALTIME_MODULE = window.APP = {

Loading…
Cancel
Save