Skip to content

Instantly share code, notes, and snippets.

@drublic
Created March 6, 2013 11:31
Show Gist options
  • Save drublic/5098709 to your computer and use it in GitHub Desktop.
Save drublic/5098709 to your computer and use it in GitHub Desktop.
// Some configuration
var config = {
moduleName: {
moduleContextSelector: '.select-an-awesome > .module',
moduleTitle: 'Some Arbitrary Title',
moduleTimeoutSpeed: 3000
}
};
// New module
Namespace.ModuleName = function () {
return {
// Set the module's title
setModuleTitle: function () {
setTimeout(function () {
// Set the title using the config
$('h2', config.moduleName.moduleContextSelector).text(config.moduleName.moduleTitle);
// Use configured speed, rather than setting it manually
}, config.moduleName.moduleTimeoutSpeed);
}
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment