From 6af1ba5ffa9b9d3deb2fe72af99cbefcb66a9949 Mon Sep 17 00:00:00 2001 From: jlukic Date: Sun, 23 Nov 2014 19:00:06 -0500 Subject: [PATCH] Fix init issue when is undefined #1272 --- src/definitions/modules/popup.js | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/definitions/modules/popup.js b/src/definitions/modules/popup.js index 789ef6a9f..041d7783b 100644 --- a/src/definitions/modules/popup.js +++ b/src/definitions/modules/popup.js @@ -90,7 +90,7 @@ $.fn.popup = function(parameters) { if( !module.exists() ) { module.create(); } - else if(settings.hoverable) { + if(settings.hoverable) { module.bind.popup(); } module.instantiate(); @@ -662,10 +662,12 @@ $.fn.popup = function(parameters) { bind: { popup: function() { module.verbose('Allowing hover events on popup to prevent closing'); - $popup - .on('mouseenter' + eventNamespace, module.event.start) - .on('mouseleave' + eventNamespace, module.event.end) - ; + if($popup && $popup.size() > 0) { + $popup + .on('mouseenter' + eventNamespace, module.event.start) + .on('mouseleave' + eventNamespace, module.event.end) + ; + } }, close:function() { if(settings.hideOnScroll === true || settings.hideOnScroll == 'auto' && settings.on != 'click') {