From 1fef2c812848fe5fcfe9a585e643aec747f70f50 Mon Sep 17 00:00:00 2001 From: Jake Howard Date: Thu, 7 Jan 2016 22:47:21 +0000 Subject: [PATCH] Remove the hacky center positioning of dropdowns, flexbox all the way! --- static/src/js/events.js | 12 +----------- static/src/less/navbar.less | 3 +++ 2 files changed, 4 insertions(+), 11 deletions(-) diff --git a/static/src/js/events.js b/static/src/js/events.js index 69b88df..bf45c32 100644 --- a/static/src/js/events.js +++ b/static/src/js/events.js @@ -2,7 +2,7 @@ var is_navbar_attached = false; $(window).load(function() { - $(window).trigger('scroll').trigger('resize'); + $(window).trigger('scroll'); }); function detach_navbar() { @@ -42,14 +42,6 @@ function position_navbar() { }); } -function space_navbar() { //This really should be CSS! - if ($(window).width() < 862) { return; } // @screen-sm - var nav_width = $('#navigation').outerWidth(true); - var full_width = $('nav > .container-fluid').outerWidth(true) - $('.home-button').outerWidth(true); - var margin = (full_width - nav_width) / 2; - $('#navigation').css('margin-left', margin); -} - $(function() { // https://css-tricks.com/snippets/jquery/smooth-scrolling/ $('a[href*=#]:not([href=#])').click(function() { if (location.pathname.replace(/^\//, '') === this.pathname.replace(/^\//, '') @@ -72,5 +64,3 @@ $('a[href="soon"]').click(function (e) { }); $(window).scroll(position_navbar); - -$(window).resize(space_navbar); diff --git a/static/src/less/navbar.less b/static/src/less/navbar.less index 49f3440..89c28d6 100644 --- a/static/src/less/navbar.less +++ b/static/src/less/navbar.less @@ -20,6 +20,9 @@ } #navigation { + .flexbox(); + justify-content: center; + float: none; & a { .transition(~"ease-in-out .3s color"); }