From d08337134c12cbcdfed52e470aaee82345d10467 Mon Sep 17 00:00:00 2001 From: jlukic Date: Tue, 31 Mar 2015 11:23:56 -0400 Subject: [PATCH] Fixes #2042 bind events with delegation in general --- src/definitions/modules/modal.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/definitions/modules/modal.js b/src/definitions/modules/modal.js index 206ec0742..5dae5bbd9 100644 --- a/src/definitions/modules/modal.js +++ b/src/definitions/modules/modal.js @@ -80,7 +80,6 @@ $.fn.modal = function(parameters) { module.create.dimmer(); module.refreshModals(); - module.verbose('Attaching close events', $close); module.bind.events(); module.observeChanges(); module.instantiate(); @@ -189,8 +188,13 @@ $.fn.modal = function(parameters) { bind: { events: function() { - $close.on('click' + eventNamespace, module.event.close); - $window.on('resize' + elementNamespace, module.event.resize); + module.verbose('Attaching events'); + $module + .on('click' + eventNamespace, selector.close, module.event.close) + ; + $window + .on('resize' + elementNamespace, module.event.resize) + ; } },