Skip to content
This repository has been archived by the owner on Jun 14, 2020. It is now read-only.

Commit

Permalink
Fix #519 problem of deferred loading after $.ready. Also fix error in…
Browse files Browse the repository at this point in the history
… content load.
  • Loading branch information
Craga89 committed May 7, 2013
1 parent 6e97407 commit 6a2db0d
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/core/constants.js
Expand Up @@ -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',
Expand Down
10 changes: 5 additions & 5 deletions src/core/content.js
Expand Up @@ -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);
});
}

Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/core/defaults.js
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/core/events.js
Expand Up @@ -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
Expand Down

0 comments on commit 6a2db0d

Please sign in to comment.