From a6238f06c110bbe836f80af2f9cec7b8549698f8 Mon Sep 17 00:00:00 2001 From: Jack Lukic Date: Wed, 1 Jun 2016 18:57:21 -0700 Subject: [PATCH] Fixes issue where if context is removed visibilty observers will not properly remove events --- src/definitions/behaviors/visibility.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/definitions/behaviors/visibility.js b/src/definitions/behaviors/visibility.js index e44b2a5d9..4bdf64bc9 100644 --- a/src/definitions/behaviors/visibility.js +++ b/src/definitions/behaviors/visibility.js @@ -144,7 +144,7 @@ $.fn.visibility = function(parameters) { if('MutationObserver' in window) { contextObserver = new MutationObserver(module.event.contextChanged); observer = new MutationObserver(module.event.changed); - contextObserver.observe($context[0], { + contextObserver.observe(document, { childList : true, subtree : true });