From 88f1f993f0e300a89213d6a4b33566c64a79e4d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gijs=20Rog=C3=A9?= Date: Thu, 9 Jul 2015 10:53:58 +0200 Subject: [PATCH] fixed issue if user resized multiple times items are moved back without the whitespace character between items so the children width would be equal than container width. --- src/priority-nav.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/priority-nav.js b/src/priority-nav.js index 676239e..0c37dc8 100644 --- a/src/priority-nav.js +++ b/src/priority-nav.js @@ -291,7 +291,7 @@ /** * Keep executing until all menu items that are overflowing are moved */ - while (totalWidth < restWidth && _this.querySelector(mainNav).children.length > 0 || viewportWidth < settings.breakPoint && _this.querySelector(mainNav).children.length > 0) { + while (totalWidth <= restWidth && _this.querySelector(mainNav).children.length > 0 || viewportWidth < settings.breakPoint && _this.querySelector(mainNav).children.length > 0) { //move item to dropdown priorityNav.toDropdown(_this, identifier); //recalculate widths @@ -303,7 +303,7 @@ /** * Keep executing until all menu items that are able to move back are moved */ - while (totalWidth > breaks[identifier][breaks[identifier].length - 1] && viewportWidth > settings.breakPoint) { + while (totalWidth >= breaks[identifier][breaks[identifier].length - 1] && viewportWidth > settings.breakPoint) { //move item to menu priorityNav.toMenu(_this, identifier); //update dropdownToggle label