Skip to content

Commit

Permalink
fixed issue if user resized multiple times items are moved back witho…
Browse files Browse the repository at this point in the history
…ut the whitespace character between items so the children width would be equal than container width.
  • Loading branch information
gijsroge committed Jul 9, 2015
1 parent b27cd73 commit 88f1f99
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/priority-nav.js
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 88f1f99

Please sign in to comment.