From e2d4b4c00e886c2a48f658f9a2d8bcf63acb7e49 Mon Sep 17 00:00:00 2001 From: "Francisco L. Hames Junior" Date: Tue, 23 Feb 2016 13:00:03 -0300 Subject: [PATCH 1/2] addEventListener only accept a string as type --- src/views/composer.observe.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/composer.observe.js b/src/views/composer.observe.js index e8203e9..6c5fbc5 100644 --- a/src/views/composer.observe.js +++ b/src/views/composer.observe.js @@ -534,7 +534,7 @@ this.focusState = this.getValue(false, false); // --------- destroy:composer event --------- - container.addEventListener(["DOMNodeRemoved"], handleDomNodeRemoved.bind(this), false); + container.addEventListener("DOMNodeRemoved", handleDomNodeRemoved.bind(this), false); // DOMNodeRemoved event is not supported in IE 8 // TODO: try to figure out a polyfill style fix, so it could be transferred to polyfills and removed if ie8 is not needed From 7b49b86f22ce6deaae33cab18099382e23f44ece Mon Sep 17 00:00:00 2001 From: "Francisco L. Hames Junior" Date: Tue, 23 Feb 2016 13:03:03 -0300 Subject: [PATCH 2/2] DOMNodeRemoved is not fired if parent element is removed --- src/views/composer.observe.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/views/composer.observe.js b/src/views/composer.observe.js index 6c5fbc5..c5a05ed 100644 --- a/src/views/composer.observe.js +++ b/src/views/composer.observe.js @@ -535,6 +535,7 @@ // --------- destroy:composer event --------- container.addEventListener("DOMNodeRemoved", handleDomNodeRemoved.bind(this), false); + container.addEventListener("DOMNodeRemovedFromDocument", handleDomNodeRemoved.bind(this), false); // DOMNodeRemoved event is not supported in IE 8 // TODO: try to figure out a polyfill style fix, so it could be transferred to polyfills and removed if ie8 is not needed