diff --git a/src/core/constants.js b/src/core/constants.js index af3c938c..4630fb78 100644 --- a/src/core/constants.js +++ b/src/core/constants.js @@ -28,6 +28,7 @@ ATTR_HAS = 'data-hasqtip', ATTR_ID = 'data-qtip-id', WIDGET = ['ui-widget', 'ui-tooltip'], SELECTOR = '.'+NAMESPACE, +INACTIVE_EVENTS = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' '), CLASS_FIXED = NAMESPACE+'-fixed', CLASS_DEFAULT = NAMESPACE + '-default', diff --git a/src/core/content.js b/src/core/content.js index 7cc4d707..bf30fae7 100644 --- a/src/core/content.js +++ b/src/core/content.js @@ -15,9 +15,9 @@ PROTOTYPE._update = function(content, element, reposition) { cache.waiting = TRUE; return content.then(function(c) { cache.waiting = FALSE; - return self._updateContent(c, reposition); - }, NULL, function(c) { - return self._updateContent(c, reposition); + return self._update(c, element, reposition); + }, NULL, function(e) { + return self._update(e, element, reposition); }); } @@ -35,12 +35,12 @@ PROTOTYPE._update = function(content, element, reposition) { // Ensure images have loaded... cache.waiting = TRUE; return element.imagesLoaded() - .done(function() { + .done(function(images) { cache.waiting = FALSE; // Reposition if rendered if(reposition !== FALSE && self.rendered && self.tooltip[0].offsetWidth > 0) { - self.reposition(cache.event); + self.reposition(cache.event, !images.length); } }) .promise(); diff --git a/src/core/defaults.js b/src/core/defaults.js index 509b2637..b2db8970 100644 --- a/src/core/defaults.js +++ b/src/core/defaults.js @@ -5,7 +5,7 @@ QTIP.version = '@@VERSION'; QTIP.nextid = 0; // Inactive events array -QTIP.inactiveEvents = 'click dblclick mousedown mouseup mousemove mouseleave mouseenter'.split(' '); +QTIP.inactiveEvents = INACTIVE_EVENTS; // Base z-index for all qTips QTIP.zindex = 15000; diff --git a/src/core/events.js b/src/core/events.js index fe59f9c6..a3d2794f 100644 --- a/src/core/events.js +++ b/src/core/events.js @@ -128,7 +128,7 @@ $(function() { }); // Define events which reset the 'inactive' event handler - delegate('['+ATTR_ID+']', QTIP.inactiveEvents, inactiveMethod); + delegate('['+ATTR_ID+']', INACTIVE_EVENTS, inactiveMethod); }); // Event trigger