Plugin Directory

Changeset 2608529


Ignore:
Timestamp:
10/03/2021 04:52:42 PM (4 years ago)
Author:
jweathe
Message:

wtch for window resize, corrected configuration labels

Location:
mean-menu-refueled
Files:
4 edited
9 copied

Legend:

Unmodified
Added
Removed
  • mean-menu-refueled/tags/1.3/plugin.php

    r2608272 r2608529  
    55Plugin URI: https://planetjon.ca/projects/mean-menu-refueled/
    66Description: Make any menu suitable for mobile
    7 Version: 1.2
     7Version: 1.3
    88Requires at least: 5.0.0
    99Tested up to: 5.8
     
    2020    'target' => [ 'type' => 'text', 'label' => 'Menu target', 'description' => 'Where is target menu contained? Leave blank for auto-detection of parent of first ul.menu element', 'input_attrs' => [] ],
    2121    'container' => [ 'type' => 'text', 'label' => 'Menu container', 'description' => 'Where should mean menu be anchored?', 'input_attrs' => [ 'placeholder' => 'body' ] ],
    22     'barColour' => [ 'type' => 'color', 'label' => 'Bar colour', 'description' => 'Colour of the mean bar', 'default' => '#0c1923' ],
    23     'navColour' => [ 'type' => 'color', 'label' => 'Menu colour', 'description' => 'Colour of the expanded menu', 'default' => '#0c1923' ],
     22    'barColour' => [ 'type' => 'color', 'label' => 'Bar colour', 'description' => 'Background colour of the mean bar', 'default' => '#0c1923' ],
     23    'navColour' => [ 'type' => 'color', 'label' => 'Menu colour', 'description' => 'Background colour of the expanded menu', 'default' => '#0c1923' ],
    2424    'menuClose' => [ 'type' => 'text', 'label' => 'Menu close', 'description' => 'Symbol shown to close the menu', 'input_attrs' => [ 'placeholder' => 'x' ] ],
    2525    'menuOpen' => [ 'type' => 'text', 'label' => 'Menu open', 'description' => 'Symbol shown to open the menu', 'input_attrs' => [ 'placeholder' => '≡' ] ],
    2626    'revealPosition' => [ 'type' => 'select', 'label' => 'Reveal position', 'description' => 'Position of the reveal', 'choices' => [ 'right' => 'right', 'center' => 'center', 'left' => 'left' ], 'default' => 'right' ],
    2727    'revealPositionDistance' => [ 'type' => 'text', 'label' => 'Reveal position offset', 'description' => 'Offset of the reveal', 'input_attrs' => [ 'placeholder' => '0' ] ],
    28     'revealColour' => [ 'type' => 'color', 'label' => 'Reveal colour', 'description' => 'Colour of the reveal', 'default' => 'none' ],
    29     'screenWidth' => [ 'type' => 'number', 'label' => 'Responsive threshold', 'description' => 'Threshold when menu is activated (pixels)', 'input_attrs' => [ 'placeholder' => '960' ] ],
     28    'revealColour' => [ 'type' => 'color', 'label' => 'Reveal colour', 'description' => 'Background colour of the reveal', 'default' => 'none' ],
     29    'screenWidth' => [ 'type' => 'number', 'label' => 'Responsive threshold', 'description' => 'Threshold when menu is activated (pixels)', 'input_attrs' => [ 'placeholder' => '640' ] ],
    3030    'navPush' => [ 'type' => 'text', 'label' => 'Nav push', 'description' => 'Vertical push when mobile menu is shown', 'input_attrs' => [ 'placeholder' => '0' ] ],
    3131    'showChildren' => [ 'type' => 'checkbox', 'label' => 'Show children', 'description' => 'Include submenus', 'default' => true ],
  • mean-menu-refueled/tags/1.3/readme.txt

    r2608272 r2608529  
    66Tested up to: 5.8
    77Requires PHP: 5.4
    8 Stable tag: 1.2
     8Stable tag: 1.3
    99License: GPL2
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2121- **Menu target** A CSS selector to the closest container where the menu resides. Leave blank for an attempt at auto-detection with ul.menu (The WP default).
    2222- **Menu anchor** A CSS selector to the container where the mean menu will reside. If you're unsure, try `body`.
    23 - **Bar colour** The bckground colour of the mean menu bar.
     23- **Bar colour** The background colour of the mean menu bar.
    2424- **Menu colour** The background colour of the expanded mean menu.
    2525- **Menu close** The symbol that will be used when the menu is expanded. This can be any unicode character or HTML entity.
     
    2727- **Reveal position** The justification of the mean menu state symbol.
    2828- **Reveal position offset** Horizontal offset applied to the mean menu state symbol. This is intelligently applied depending on the justification, and has no effect when centered.
    29 - **Reveal colour** The font colour of the mean menu state symbol.
     29- **Reveal colour** The background colour of the mean menu state symbol.
    3030- **Responsive threshold** The viewport threshold of when the mean menu replaced the standard menu.
    3131- **Nav push** Vertical offset applied to the expanded component of the mean menu.
     
    6161== Changelog ==
    6262
     63= 1.3 =
     64* Mean Menu now adapts to window resize
     65* Corrected some configuration text labels
     66
    6367= 1.2 =
    6468* Automatic menu detection as a feature
  • mean-menu-refueled/tags/1.3/vendor/meanMenu/meanmenu.js

    r2608272 r2608529  
    208208    } )
    209209
     210    window.addEventListener( "resize", function(e) {
     211        applyMean()
     212    } )
     213
    210214    applyMean()
    211215}
  • mean-menu-refueled/tags/1.3/vendor/meanMenu/meanmenu.min.js

    r2608272 r2608529  
    1 function MeanMenu(e,n={}){var a;const c=Object.assign({},{meanMenuContainer:"body",meanBarColour:"#0c1923",meanNavColour:"inherit",meanMenuClose:"x",meanMenuOpen:"≡",meanRevealPosition:"right",meanRevealPositionDistance:"0",meanRevealColour:"none",meanScreenWidth:640,meanNavPush:!1,meanShowChildren:!0,meanExpandableChildren:!0,meanExpand:"+",meanContract:"-",meanRemoveAttrs:!1,onePage:!1,removeElements:null,meanDisplay:"block"},n),u=e instanceof Element?e:document.querySelector(e),d=document.querySelector(c.meanMenuContainer),v={menuOn:!1,menuOpen:!1};function t(){var e=d.querySelector(".mean-reveal"),n=e.classList.contains("mean-close")?c.meanMenuClose:c.meanMenuOpen;e.innerHTML=n}function l(){v.menuOn=!0;var e,n,a,t={backgroundColor:c.meanBarColour},l={backgroundColor:c.meanNavColour},o=Object.assign({},function(e){let n;switch(e){case"right":n={right:c.meanRevealPositionDistance,left:"auto"};break;case"left":n={left:c.meanRevealPositionDistance,right:"auto"};break;case"center":n={left:0,right:0,marginLeft:"auto",marginRight:"auto"}}return n}(c.meanRevealPosition),{backgroundColor:c.meanRevealColour});d.classList.add("mean-container");const r=document.createElement("div");for(e in r.classList.add("mean-bar"),t)r.style[e]=t[e];const i=document.createElement("a");for(n in i.setAttribute("href","#nav"),i.setAttribute("title","Toggle navigation"),i.className="mean-reveal",o)i.style[n]=o[n];const s=document.createElement("nav");for(a in s.className="mean-nav",l)s.style[a]=l[a];if(s.innerHTML=u.innerHTML,r.append(i,s),d.prepend(r),c.removeElements&&document.querySelectorAll(c.removeElements).forEach(function(e){e.classList.add("mean-remove")}),c.meanRemoveAttrs&&d.querySelectorAll("nav.mean-nav ul, nav.mean-nav ul *").each(function(e){e.removeAttribute("id"),e.className=""}),c.meanNavPush){const m=document.createElement("div");m.className="nav-push",m.style="height:"+c.meanNavPush,u.parentNode.insertBefore(m,u)}u.style.display="none",d.querySelectorAll(".mean-nav ul").forEach(function(e){e.style.display="none"}),d.querySelectorAll(".mean-nav ul ul").forEach(function(e){if(c.meanShowChildren&&c.meanExpandableChildren){if(e.hasChildNodes()){const n=document.createElement("a");n.setAttribute("href","#nav"),n.setAttribute("title","Toggle submenu"),n.className="mean-expand",n.innerHTML=c.meanExpand,e.parentNode.append(n)}}else e.style.display=c.meanShowChildren?"inline":"none"})}function o(){v.menuOpen=!1,d.querySelector(".mean-nav ul").style.display="none",d.querySelector(".mean-reveal").classList.toggle("mean-close"),t()}c.onePage&&d.querySelectorAll(".mean-nav ul > li > a:first-child").forEach(function(e){e.addEventListener("click",o)}),d.addEventListener("click",function(e){if(e.target.matches(".mean-reveal")){e.preventDefault(),v.menuOpen=!v.menuOpen;const n=d.querySelector(".mean-nav ul");e="block"===n.style.display?"none":"block";n.style.display=e,d.querySelector(".mean-reveal").classList.toggle("mean-close"),t()}}),d.addEventListener("click",function(e){var n,a;e.target.matches(".mean-expand")&&(e.preventDefault(),n=e.target.classList.contains("mean-clicked"),a=e.target.previousElementSibling.style.display,e.target.classList.toggle("mean-clicked"),e.target.innerHTML=n?c.meanExpand:c.meanContract,e.target.previousElementSibling.style.display="block"===a?"none":"block")}),(a=window.innerWidth||document.documentElement.clientWidth)<=c.meanScreenWidth&&!v.menuOn?(l(),t()):a>c.meanScreenWidth&&v.menuOn&&(v.menuOn=!1,u.style.display=c.meanDisplay,d.classList.remove("mean-container"),d.querySelectorAll(".mean-bar, .mean-push").forEach(function(e){e.parentNode.removeChild(e)}),c.removeElements&&document.querySelectorAll(c.removeElements).forEach(function(e){e.classList.remove("mean-remove")}))}
     1function MeanMenu(e,n={}){const m=Object.assign({},{meanMenuContainer:"body",meanBarColour:"#0c1923",meanNavColour:"inherit",meanMenuClose:"x",meanMenuOpen:"≡",meanRevealPosition:"right",meanRevealPositionDistance:"0",meanRevealColour:"none",meanScreenWidth:640,meanNavPush:!1,meanShowChildren:!0,meanExpandableChildren:!0,meanExpand:"+",meanContract:"-",meanRemoveAttrs:!1,onePage:!1,removeElements:null,meanDisplay:"block"},n),u=e instanceof Element?e:document.querySelector(e),d=document.querySelector(m.meanMenuContainer),v={menuOn:!1,menuOpen:!1};function a(){var e=d.querySelector(".mean-reveal"),n=e.classList.contains("mean-close")?m.meanMenuClose:m.meanMenuOpen;e.innerHTML=n}function t(){v.menuOn=!0;var e,n,a,t={backgroundColor:m.meanBarColour},l={backgroundColor:m.meanNavColour},o=Object.assign({},function(e){let n;switch(e){case"right":n={right:m.meanRevealPositionDistance,left:"auto"};break;case"left":n={left:m.meanRevealPositionDistance,right:"auto"};break;case"center":n={left:0,right:0,marginLeft:"auto",marginRight:"auto"}}return n}(m.meanRevealPosition),{backgroundColor:m.meanRevealColour});d.classList.add("mean-container");const r=document.createElement("div");for(e in r.classList.add("mean-bar"),t)r.style[e]=t[e];const i=document.createElement("a");for(n in i.setAttribute("href","#nav"),i.setAttribute("title","Toggle navigation"),i.className="mean-reveal",o)i.style[n]=o[n];const s=document.createElement("nav");for(a in s.className="mean-nav",l)s.style[a]=l[a];if(s.innerHTML=u.innerHTML,r.append(i,s),d.prepend(r),m.removeElements&&document.querySelectorAll(m.removeElements).forEach(function(e){e.classList.add("mean-remove")}),m.meanRemoveAttrs&&d.querySelectorAll("nav.mean-nav ul, nav.mean-nav ul *").each(function(e){e.removeAttribute("id"),e.className=""}),m.meanNavPush){const c=document.createElement("div");c.className="nav-push",c.style="height:"+m.meanNavPush,u.parentNode.insertBefore(c,u)}u.style.display="none",d.querySelectorAll(".mean-nav ul").forEach(function(e){e.style.display="none"}),d.querySelectorAll(".mean-nav ul ul").forEach(function(e){if(m.meanShowChildren&&m.meanExpandableChildren){if(e.hasChildNodes()){const n=document.createElement("a");n.setAttribute("href","#nav"),n.setAttribute("title","Toggle submenu"),n.className="mean-expand",n.innerHTML=m.meanExpand,e.parentNode.append(n)}}else e.style.display=m.meanShowChildren?"inline":"none"})}function l(){var e=window.innerWidth||document.documentElement.clientWidth;e<=m.meanScreenWidth&&!v.menuOn?(t(),a()):e>m.meanScreenWidth&&v.menuOn&&(v.menuOn=!1,u.style.display=m.meanDisplay,d.classList.remove("mean-container"),d.querySelectorAll(".mean-bar, .mean-push").forEach(function(e){e.parentNode.removeChild(e)}),m.removeElements&&document.querySelectorAll(m.removeElements).forEach(function(e){e.classList.remove("mean-remove")}))}function o(){v.menuOpen=!1,d.querySelector(".mean-nav ul").style.display="none",d.querySelector(".mean-reveal").classList.toggle("mean-close"),a()}m.onePage&&d.querySelectorAll(".mean-nav ul > li > a:first-child").forEach(function(e){e.addEventListener("click",o)}),d.addEventListener("click",function(e){if(e.target.matches(".mean-reveal")){e.preventDefault(),v.menuOpen=!v.menuOpen;const n=d.querySelector(".mean-nav ul");e="block"===n.style.display?"none":"block";n.style.display=e,d.querySelector(".mean-reveal").classList.toggle("mean-close"),a()}}),d.addEventListener("click",function(e){var n,a;e.target.matches(".mean-expand")&&(e.preventDefault(),n=e.target.classList.contains("mean-clicked"),a=e.target.previousElementSibling.style.display,e.target.classList.toggle("mean-clicked"),e.target.innerHTML=n?m.meanExpand:m.meanContract,e.target.previousElementSibling.style.display="block"===a?"none":"block")}),window.addEventListener("resize",function(e){l()}),l()}
  • mean-menu-refueled/trunk/plugin.php

    r2608272 r2608529  
    55Plugin URI: https://planetjon.ca/projects/mean-menu-refueled/
    66Description: Make any menu suitable for mobile
    7 Version: 1.2
     7Version: 1.3
    88Requires at least: 5.0.0
    99Tested up to: 5.8
     
    2020    'target' => [ 'type' => 'text', 'label' => 'Menu target', 'description' => 'Where is target menu contained? Leave blank for auto-detection of parent of first ul.menu element', 'input_attrs' => [] ],
    2121    'container' => [ 'type' => 'text', 'label' => 'Menu container', 'description' => 'Where should mean menu be anchored?', 'input_attrs' => [ 'placeholder' => 'body' ] ],
    22     'barColour' => [ 'type' => 'color', 'label' => 'Bar colour', 'description' => 'Colour of the mean bar', 'default' => '#0c1923' ],
    23     'navColour' => [ 'type' => 'color', 'label' => 'Menu colour', 'description' => 'Colour of the expanded menu', 'default' => '#0c1923' ],
     22    'barColour' => [ 'type' => 'color', 'label' => 'Bar colour', 'description' => 'Background colour of the mean bar', 'default' => '#0c1923' ],
     23    'navColour' => [ 'type' => 'color', 'label' => 'Menu colour', 'description' => 'Background colour of the expanded menu', 'default' => '#0c1923' ],
    2424    'menuClose' => [ 'type' => 'text', 'label' => 'Menu close', 'description' => 'Symbol shown to close the menu', 'input_attrs' => [ 'placeholder' => 'x' ] ],
    2525    'menuOpen' => [ 'type' => 'text', 'label' => 'Menu open', 'description' => 'Symbol shown to open the menu', 'input_attrs' => [ 'placeholder' => '≡' ] ],
    2626    'revealPosition' => [ 'type' => 'select', 'label' => 'Reveal position', 'description' => 'Position of the reveal', 'choices' => [ 'right' => 'right', 'center' => 'center', 'left' => 'left' ], 'default' => 'right' ],
    2727    'revealPositionDistance' => [ 'type' => 'text', 'label' => 'Reveal position offset', 'description' => 'Offset of the reveal', 'input_attrs' => [ 'placeholder' => '0' ] ],
    28     'revealColour' => [ 'type' => 'color', 'label' => 'Reveal colour', 'description' => 'Colour of the reveal', 'default' => 'none' ],
    29     'screenWidth' => [ 'type' => 'number', 'label' => 'Responsive threshold', 'description' => 'Threshold when menu is activated (pixels)', 'input_attrs' => [ 'placeholder' => '960' ] ],
     28    'revealColour' => [ 'type' => 'color', 'label' => 'Reveal colour', 'description' => 'Background colour of the reveal', 'default' => 'none' ],
     29    'screenWidth' => [ 'type' => 'number', 'label' => 'Responsive threshold', 'description' => 'Threshold when menu is activated (pixels)', 'input_attrs' => [ 'placeholder' => '640' ] ],
    3030    'navPush' => [ 'type' => 'text', 'label' => 'Nav push', 'description' => 'Vertical push when mobile menu is shown', 'input_attrs' => [ 'placeholder' => '0' ] ],
    3131    'showChildren' => [ 'type' => 'checkbox', 'label' => 'Show children', 'description' => 'Include submenus', 'default' => true ],
  • mean-menu-refueled/trunk/readme.txt

    r2608272 r2608529  
    66Tested up to: 5.8
    77Requires PHP: 5.4
    8 Stable tag: 1.2
     8Stable tag: 1.3
    99License: GPL2
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2121- **Menu target** A CSS selector to the closest container where the menu resides. Leave blank for an attempt at auto-detection with ul.menu (The WP default).
    2222- **Menu anchor** A CSS selector to the container where the mean menu will reside. If you're unsure, try `body`.
    23 - **Bar colour** The bckground colour of the mean menu bar.
     23- **Bar colour** The background colour of the mean menu bar.
    2424- **Menu colour** The background colour of the expanded mean menu.
    2525- **Menu close** The symbol that will be used when the menu is expanded. This can be any unicode character or HTML entity.
     
    2727- **Reveal position** The justification of the mean menu state symbol.
    2828- **Reveal position offset** Horizontal offset applied to the mean menu state symbol. This is intelligently applied depending on the justification, and has no effect when centered.
    29 - **Reveal colour** The font colour of the mean menu state symbol.
     29- **Reveal colour** The background colour of the mean menu state symbol.
    3030- **Responsive threshold** The viewport threshold of when the mean menu replaced the standard menu.
    3131- **Nav push** Vertical offset applied to the expanded component of the mean menu.
     
    6161== Changelog ==
    6262
     63= 1.3 =
     64* Mean Menu now adapts to window resize
     65* Corrected some configuration text labels
     66
    6367= 1.2 =
    6468* Automatic menu detection as a feature
  • mean-menu-refueled/trunk/vendor/meanMenu/meanmenu.js

    r2608272 r2608529  
    208208    } )
    209209
     210    window.addEventListener( "resize", function(e) {
     211        applyMean()
     212    } )
     213
    210214    applyMean()
    211215}
  • mean-menu-refueled/trunk/vendor/meanMenu/meanmenu.min.js

    r2608272 r2608529  
    1 function MeanMenu(e,n={}){var a;const c=Object.assign({},{meanMenuContainer:"body",meanBarColour:"#0c1923",meanNavColour:"inherit",meanMenuClose:"x",meanMenuOpen:"≡",meanRevealPosition:"right",meanRevealPositionDistance:"0",meanRevealColour:"none",meanScreenWidth:640,meanNavPush:!1,meanShowChildren:!0,meanExpandableChildren:!0,meanExpand:"+",meanContract:"-",meanRemoveAttrs:!1,onePage:!1,removeElements:null,meanDisplay:"block"},n),u=e instanceof Element?e:document.querySelector(e),d=document.querySelector(c.meanMenuContainer),v={menuOn:!1,menuOpen:!1};function t(){var e=d.querySelector(".mean-reveal"),n=e.classList.contains("mean-close")?c.meanMenuClose:c.meanMenuOpen;e.innerHTML=n}function l(){v.menuOn=!0;var e,n,a,t={backgroundColor:c.meanBarColour},l={backgroundColor:c.meanNavColour},o=Object.assign({},function(e){let n;switch(e){case"right":n={right:c.meanRevealPositionDistance,left:"auto"};break;case"left":n={left:c.meanRevealPositionDistance,right:"auto"};break;case"center":n={left:0,right:0,marginLeft:"auto",marginRight:"auto"}}return n}(c.meanRevealPosition),{backgroundColor:c.meanRevealColour});d.classList.add("mean-container");const r=document.createElement("div");for(e in r.classList.add("mean-bar"),t)r.style[e]=t[e];const i=document.createElement("a");for(n in i.setAttribute("href","#nav"),i.setAttribute("title","Toggle navigation"),i.className="mean-reveal",o)i.style[n]=o[n];const s=document.createElement("nav");for(a in s.className="mean-nav",l)s.style[a]=l[a];if(s.innerHTML=u.innerHTML,r.append(i,s),d.prepend(r),c.removeElements&&document.querySelectorAll(c.removeElements).forEach(function(e){e.classList.add("mean-remove")}),c.meanRemoveAttrs&&d.querySelectorAll("nav.mean-nav ul, nav.mean-nav ul *").each(function(e){e.removeAttribute("id"),e.className=""}),c.meanNavPush){const m=document.createElement("div");m.className="nav-push",m.style="height:"+c.meanNavPush,u.parentNode.insertBefore(m,u)}u.style.display="none",d.querySelectorAll(".mean-nav ul").forEach(function(e){e.style.display="none"}),d.querySelectorAll(".mean-nav ul ul").forEach(function(e){if(c.meanShowChildren&&c.meanExpandableChildren){if(e.hasChildNodes()){const n=document.createElement("a");n.setAttribute("href","#nav"),n.setAttribute("title","Toggle submenu"),n.className="mean-expand",n.innerHTML=c.meanExpand,e.parentNode.append(n)}}else e.style.display=c.meanShowChildren?"inline":"none"})}function o(){v.menuOpen=!1,d.querySelector(".mean-nav ul").style.display="none",d.querySelector(".mean-reveal").classList.toggle("mean-close"),t()}c.onePage&&d.querySelectorAll(".mean-nav ul > li > a:first-child").forEach(function(e){e.addEventListener("click",o)}),d.addEventListener("click",function(e){if(e.target.matches(".mean-reveal")){e.preventDefault(),v.menuOpen=!v.menuOpen;const n=d.querySelector(".mean-nav ul");e="block"===n.style.display?"none":"block";n.style.display=e,d.querySelector(".mean-reveal").classList.toggle("mean-close"),t()}}),d.addEventListener("click",function(e){var n,a;e.target.matches(".mean-expand")&&(e.preventDefault(),n=e.target.classList.contains("mean-clicked"),a=e.target.previousElementSibling.style.display,e.target.classList.toggle("mean-clicked"),e.target.innerHTML=n?c.meanExpand:c.meanContract,e.target.previousElementSibling.style.display="block"===a?"none":"block")}),(a=window.innerWidth||document.documentElement.clientWidth)<=c.meanScreenWidth&&!v.menuOn?(l(),t()):a>c.meanScreenWidth&&v.menuOn&&(v.menuOn=!1,u.style.display=c.meanDisplay,d.classList.remove("mean-container"),d.querySelectorAll(".mean-bar, .mean-push").forEach(function(e){e.parentNode.removeChild(e)}),c.removeElements&&document.querySelectorAll(c.removeElements).forEach(function(e){e.classList.remove("mean-remove")}))}
     1function MeanMenu(e,n={}){const m=Object.assign({},{meanMenuContainer:"body",meanBarColour:"#0c1923",meanNavColour:"inherit",meanMenuClose:"x",meanMenuOpen:"≡",meanRevealPosition:"right",meanRevealPositionDistance:"0",meanRevealColour:"none",meanScreenWidth:640,meanNavPush:!1,meanShowChildren:!0,meanExpandableChildren:!0,meanExpand:"+",meanContract:"-",meanRemoveAttrs:!1,onePage:!1,removeElements:null,meanDisplay:"block"},n),u=e instanceof Element?e:document.querySelector(e),d=document.querySelector(m.meanMenuContainer),v={menuOn:!1,menuOpen:!1};function a(){var e=d.querySelector(".mean-reveal"),n=e.classList.contains("mean-close")?m.meanMenuClose:m.meanMenuOpen;e.innerHTML=n}function t(){v.menuOn=!0;var e,n,a,t={backgroundColor:m.meanBarColour},l={backgroundColor:m.meanNavColour},o=Object.assign({},function(e){let n;switch(e){case"right":n={right:m.meanRevealPositionDistance,left:"auto"};break;case"left":n={left:m.meanRevealPositionDistance,right:"auto"};break;case"center":n={left:0,right:0,marginLeft:"auto",marginRight:"auto"}}return n}(m.meanRevealPosition),{backgroundColor:m.meanRevealColour});d.classList.add("mean-container");const r=document.createElement("div");for(e in r.classList.add("mean-bar"),t)r.style[e]=t[e];const i=document.createElement("a");for(n in i.setAttribute("href","#nav"),i.setAttribute("title","Toggle navigation"),i.className="mean-reveal",o)i.style[n]=o[n];const s=document.createElement("nav");for(a in s.className="mean-nav",l)s.style[a]=l[a];if(s.innerHTML=u.innerHTML,r.append(i,s),d.prepend(r),m.removeElements&&document.querySelectorAll(m.removeElements).forEach(function(e){e.classList.add("mean-remove")}),m.meanRemoveAttrs&&d.querySelectorAll("nav.mean-nav ul, nav.mean-nav ul *").each(function(e){e.removeAttribute("id"),e.className=""}),m.meanNavPush){const c=document.createElement("div");c.className="nav-push",c.style="height:"+m.meanNavPush,u.parentNode.insertBefore(c,u)}u.style.display="none",d.querySelectorAll(".mean-nav ul").forEach(function(e){e.style.display="none"}),d.querySelectorAll(".mean-nav ul ul").forEach(function(e){if(m.meanShowChildren&&m.meanExpandableChildren){if(e.hasChildNodes()){const n=document.createElement("a");n.setAttribute("href","#nav"),n.setAttribute("title","Toggle submenu"),n.className="mean-expand",n.innerHTML=m.meanExpand,e.parentNode.append(n)}}else e.style.display=m.meanShowChildren?"inline":"none"})}function l(){var e=window.innerWidth||document.documentElement.clientWidth;e<=m.meanScreenWidth&&!v.menuOn?(t(),a()):e>m.meanScreenWidth&&v.menuOn&&(v.menuOn=!1,u.style.display=m.meanDisplay,d.classList.remove("mean-container"),d.querySelectorAll(".mean-bar, .mean-push").forEach(function(e){e.parentNode.removeChild(e)}),m.removeElements&&document.querySelectorAll(m.removeElements).forEach(function(e){e.classList.remove("mean-remove")}))}function o(){v.menuOpen=!1,d.querySelector(".mean-nav ul").style.display="none",d.querySelector(".mean-reveal").classList.toggle("mean-close"),a()}m.onePage&&d.querySelectorAll(".mean-nav ul > li > a:first-child").forEach(function(e){e.addEventListener("click",o)}),d.addEventListener("click",function(e){if(e.target.matches(".mean-reveal")){e.preventDefault(),v.menuOpen=!v.menuOpen;const n=d.querySelector(".mean-nav ul");e="block"===n.style.display?"none":"block";n.style.display=e,d.querySelector(".mean-reveal").classList.toggle("mean-close"),a()}}),d.addEventListener("click",function(e){var n,a;e.target.matches(".mean-expand")&&(e.preventDefault(),n=e.target.classList.contains("mean-clicked"),a=e.target.previousElementSibling.style.display,e.target.classList.toggle("mean-clicked"),e.target.innerHTML=n?m.meanExpand:m.meanContract,e.target.previousElementSibling.style.display="block"===a?"none":"block")}),window.addEventListener("resize",function(e){l()}),l()}
Note: See TracChangeset for help on using the changeset viewer.