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

Commit

Permalink
Remove imagesLoaded from the main file. Add it as dependancy and incl…
Browse files Browse the repository at this point in the history
…ude it in dist instead.
  • Loading branch information
Craga89 committed Jul 7, 2013
1 parent 6b0c30a commit e688326
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 12 deletions.
12 changes: 4 additions & 8 deletions Gruntfile.js
Expand Up @@ -38,9 +38,6 @@ module.exports = function(grunt) {
// Directories (dist changed in init())
dirs: { src: 'src', dist: 'dist', libs: 'libs' },

// Dependancies
dependancies: [ 'imagesloaded' ],

// Core files in order
core: {
js: [
Expand Down Expand Up @@ -107,12 +104,10 @@ module.exports = function(grunt) {
},
files: {
'<%=dirs.dist%>/jquery.qtip.js': [
'<%=dirs.dist%>/jquery.qtip.js',
'<%=dirs.libs%>/imagesloaded/jquery.imagesloaded.js'
'<%=dirs.dist%>/jquery.qtip.js'
],
'<%=dirs.dist%>/jquery.qtip.min.js': [
'<%=dirs.dist%>/jquery.qtip.min.js',
'<%=dirs.libs%>/imagesloaded/jquery.imagesloaded.min.js'
'<%=dirs.dist%>/jquery.qtip.min.js'
]
}
}
Expand All @@ -126,7 +121,8 @@ module.exports = function(grunt) {
},
dist: {
files: {
'<%=dirs.dist%>/jquery.qtip.min.js': ['<%=dirs.dist%>/jquery.qtip.js']
'<%=dirs.dist%>/jquery.qtip.min.js': ['<%=dirs.dist%>/jquery.qtip.js'],
'<%=dirs.dist%>/imagesloaded.min.js': ['<%=dirs.libs%>/imagesloaded/imagesloaded.js']
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/core/content.js
Expand Up @@ -32,9 +32,9 @@ PROTOTYPE._update = function(content, element, reposition) {
// Content is a regular string, insert the new content
else { element.html(content); }

// Ensure images have loaded...
// If imagesLoaded is included, ensure images have loaded and return promise
cache.waiting = TRUE;
return element.imagesLoaded()
return ( $.fn.imagesLoaded ? element.imagesLoaded() : $.Deferred().resolve($()).promise() )
.done(function(images) {
cache.waiting = FALSE;

Expand Down
2 changes: 1 addition & 1 deletion src/core/intro.js
Expand Up @@ -8,7 +8,7 @@
(function( factory ) {
"use strict";
if(typeof define === 'function' && define.amd) {
define(['jquery'], factory);
define(['jquery', 'imagesloaded'], factory);
}
else if(jQuery && !jQuery.fn.qtip) {
factory(jQuery);
Expand Down

0 comments on commit e688326

Please sign in to comment.