~xdavidwu/xdavidwu.link

869033f011377948ee0c22f90e0908cb03fcf515 — xdavidwu 3 years ago a6ee16f
greedy nav: remove debug custom attr
2 files changed, 1 insertions(+), 2 deletions(-)

M assets/js/_greedy-navigation.js
M assets/js/main.min.js
M assets/js/_greedy-navigation.js => assets/js/_greedy-navigation.js +0 -1
@@ 41,7 41,6 @@ function check() {
    check();
  }
  // Update the button accordingly
  $btn.setAttribute("count", numOfItems - numOfVisibleItems);
  if (numOfVisibleItems === numOfItems) {
    $btn.classList.add('hidden');
  } else $btn.classList.remove('hidden');

M assets/js/main.min.js => assets/js/main.min.js +1 -1
@@ 1,1 1,1 @@
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),document.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keyup",e=>{27===e.keyCode&&document.getElementsByClassName("initial-content")[0].classList.contains("is--hidden")&&(document.getElementsByClassName("search-content")[0].classList.toggle("is--visible"),document.getElementsByClassName("initial-content")[0].classList.toggle("is--hidden"))}),document.getElementsByClassName("search__toggle")[0].addEventListener("click",()=>{document.getElementsByClassName("search-content")[0].classList.toggle("is--visible"),document.getElementsByClassName("initial-content")[0].classList.toggle("is--hidden"),setTimeout((function(){document.querySelector(".search-content input").focus()}),400)})})},function(e,t){const n=document.querySelector("nav.greedy-nav .greedy-nav__toggle"),o=document.querySelector("nav.greedy-nav .visible-links"),s=document.querySelector("nav.greedy-nav .hidden-links");var r,l,d=0,c=0,a=[];for(i of o.children)c+=i.offsetWidth,d+=1,a.push(c);function u(){r=o.offsetWidth,l=o.children.length,a[l-1]>r?(s.prepend(o.lastChild),l-=1,u()):r>a[l]&&(o.append(s.firstChild),l+=1,u()),n.setAttribute("count",d-l),l===d?n.classList.add("hidden"):n.classList.remove("hidden")}window.addEventListener("resize",()=>{u()}),n.addEventListener("click",()=>{s.classList.toggle("hidden")}),u()}]);
\ No newline at end of file
!function(e){var t={};function n(i){if(t[i])return t[i].exports;var o=t[i]={i:i,l:!1,exports:{}};return e[i].call(o.exports,o,o.exports,n),o.l=!0,o.exports}n.m=e,n.c=t,n.d=function(e,t,i){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:i})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var i=Object.create(null);if(n.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(i,o,function(t){return e[t]}.bind(null,o));return i},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=0)}([function(e,t,n){n(1),document.addEventListener("DOMContentLoaded",()=>{document.addEventListener("keyup",e=>{27===e.keyCode&&document.getElementsByClassName("initial-content")[0].classList.contains("is--hidden")&&(document.getElementsByClassName("search-content")[0].classList.toggle("is--visible"),document.getElementsByClassName("initial-content")[0].classList.toggle("is--hidden"))}),document.getElementsByClassName("search__toggle")[0].addEventListener("click",()=>{document.getElementsByClassName("search-content")[0].classList.toggle("is--visible"),document.getElementsByClassName("initial-content")[0].classList.toggle("is--hidden"),setTimeout((function(){document.querySelector(".search-content input").focus()}),400)})})},function(e,t){const n=document.querySelector("nav.greedy-nav .greedy-nav__toggle"),o=document.querySelector("nav.greedy-nav .visible-links"),s=document.querySelector("nav.greedy-nav .hidden-links");var r,l,d=0,c=0,a=[];for(i of o.children)c+=i.offsetWidth,d+=1,a.push(c);function u(){r=o.offsetWidth,l=o.children.length,a[l-1]>r?(s.prepend(o.lastChild),l-=1,u()):r>a[l]&&(o.append(s.firstChild),l+=1,u()),l===d?n.classList.add("hidden"):n.classList.remove("hidden")}window.addEventListener("resize",()=>{u()}),n.addEventListener("click",()=>{s.classList.toggle("hidden")}),u()}]);
\ No newline at end of file