calblueprint/ashby-village

View on GitHub
app/assets/javascripts/navbar.js

Summary

Maintainability
A
45 mins
Test Coverage
var resize_navbar = function() {
  if($(window).width() < 640){
    $(".dropdown").children().each(function(index) {
      if(index > 1){
        $(".dropdown").parent().parent()[0].appendChild($(this)[0]);
      }
    });
    $(".has-dropdown a:first").hide();
  } else {
    $(".dropdown").parent().parent().children().each(function(index) {
      if(index > 2){
        $(".dropdown")[0].appendChild($(this)[0]);
      }
    });
    $(".has-dropdown a:first").show();
  }
};