Skip to content

Commit

Permalink
dom - a way to setup global defaults for plugins
Browse files Browse the repository at this point in the history
options.dir may be used to setup the relative root path for path
resolves
  • Loading branch information
mklabs committed Mar 22, 2012
1 parent 8d64c80 commit 608cab0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion grunt.js
Expand Up @@ -96,13 +96,15 @@ config.init({

files : ['*.html'],

options: {},

'script[data-build]' : require('./plugins/script'),

'link' : require('./plugins/link'),

'img' : require('./plugins/img'),

'script, link, img' : require('./plugins/rev')
'script, link, img' : require('./plugins/rev'),
},

lint: {
Expand Down
4 changes: 2 additions & 2 deletions tasks/dom.js
Expand Up @@ -80,9 +80,9 @@ task.registerHelper('dom:plugin', function(f, plugins, cb) {
name = plugin.name;

log.writeln(' » handle ' + el);
if(!$.fn[name]) return next();;
if(!$.fn[name]) return next();

var options = $.extend({}, plugin.defaults);
var options = $.extend({}, plugin.defaults, config('dom.options'));
$(el)[name]($, options, function(err) {
if(err) return cb(err);
next();
Expand Down

0 comments on commit 608cab0

Please sign in to comment.