Skip to content

Commit

Permalink
Grab latest npm plugins for grunt tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
mrjasonweaver committed Aug 3, 2013
1 parent 1b8bb8a commit e8ba440
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 15 deletions.
13 changes: 10 additions & 3 deletions Gruntfile.js
Expand Up @@ -40,8 +40,14 @@ module.exports = function(grunt) {
}
},
watch: {
files: ['coffeescripts/*.coffee', 'sass/*.scss', 'js/jquery.flexnav.js'],
tasks: ['coffeelint', 'coffee', 'sass', 'uglify']
coffee: {
files: ['<%= coffeelint.files %>'],
tasks: ['coffeelint', 'coffee']
},
sass: {
files: ['sass/*.scss'],
tasks: 'sass'
}
}
});

Expand All @@ -51,7 +57,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-coffee');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-uglify');


grunt.registerTask('build', ['uglify']);
grunt.registerTask('test', ['coffeelint']);
grunt.registerTask('default', ['sass', 'coffee', 'uglify', 'watch']);
};
11 changes: 8 additions & 3 deletions coffeescripts/jquery.flexnav.coffee
Expand Up @@ -13,9 +13,10 @@ $ = jQuery
$.fn.flexNav = (options) ->
settings = $.extend
'animationSpeed': 150,
'buttonSelector': '.menu-button'
'buttonSelector': '.menu-button',
'flexbox': true
options

$nav = $(@)
nav_open = false

Expand All @@ -24,6 +25,10 @@ $.fn.flexNav = (options) ->
if $(@).has("ul").length
$(@).addClass("item-with-ul").find("ul").hide()



if settings.flexbox = true then $nav.addClass('flexbox')

# Get the breakpoint set with data-breakpoint
if $nav.data('breakpoint') then breakpoint = $nav.data('breakpoint')

Expand All @@ -35,7 +40,7 @@ $.fn.flexNav = (options) ->
$nav.removeClass('show')
)
$('.item-with-ul').off()
else
else if $(window).width() > breakpoint
$nav.removeClass("sm-screen").addClass("lg-screen")
$nav.removeClass('show')
$('.item-with-ul').on('mouseenter', ->
Expand Down
8 changes: 6 additions & 2 deletions js/jquery.flexnav.js
Expand Up @@ -17,7 +17,8 @@
var $nav, breakpoint, nav_open, resizer, selector, settings;
settings = $.extend({
'animationSpeed': 150,
'buttonSelector': '.menu-button'
'buttonSelector': '.menu-button',
'flexbox': true
}, options);
$nav = $(this);
nav_open = false;
Expand All @@ -26,6 +27,9 @@
return $(this).addClass("item-with-ul").find("ul").hide();
}
});
if (settings.flexbox = true) {
$nav.addClass('flexbox');
}
if ($nav.data('breakpoint')) {
breakpoint = $nav.data('breakpoint');
}
Expand All @@ -36,7 +40,7 @@
return $nav.removeClass('show');
});
return $('.item-with-ul').off();
} else {
} else if ($(window).width() > breakpoint) {
$nav.removeClass("sm-screen").addClass("lg-screen");
$nav.removeClass('show');
return $('.item-with-ul').on('mouseenter', function() {
Expand Down
2 changes: 1 addition & 1 deletion js/jquery.flexnav.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions package.json
Expand Up @@ -4,11 +4,11 @@
"repository": "https://github.com/indyplanets/flexnav",
"license": "http://unlicense.org/",
"devDependencies": {
"grunt": "~0.4.1",
"grunt-contrib-coffee": "~0.7.0",
"grunt-contrib-sass": "~0.4.1",
"grunt-coffeelint": "0.0.7",
"grunt-contrib-uglify": "~0.2.2",
"grunt-contrib-watch": "~0.1.3"
"grunt": "latest",
"grunt-contrib-coffee": "latest",
"grunt-contrib-sass": "latest",
"grunt-coffeelint": "latest",
"grunt-contrib-uglify": "latest",
"grunt-contrib-watch": "latest"
}
}

0 comments on commit e8ba440

Please sign in to comment.