Skip to content

Instantly share code, notes, and snippets.

@davist11
Created April 29, 2013 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davist11/7a26d71bac8e1a7dc076 to your computer and use it in GitHub Desktop.
Save davist11/7a26d71bac8e1a7dc076 to your computer and use it in GitHub Desktop.
SITE.features = {
init: function() {
var features = $('body').data('features');
var featuresArray = [];
if (features) {
featuresArray = features.split(' ');
for(var x = 0, length = featuresArray.length; x < length; x++) {
var func = featuresArray[x];
yepnope([{
load: 'scripts/features/' + func + '.js',
complete: function () {
if(this[func] && typeof this[func].init === 'function') {
this[func].init();
}
}
}]);
}
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment