//MENU Version 3.0 //Bug fixes and added resize arrow buttons for the customizer //Below the onlclick open function for Sections, uncollapses if collapsed, switches to customize if in preview mode on small screens function wvrxSelectOptions(optionPanel) { jQuery('.accordion-section.current-panel').css('width', '300px'); // hack for Customizer's bad width calculation wp.customize.section(optionPanel).focus(); //Open the clicked section if (wvrxCM.wp_vers == '4.4') { jQuery('.accordion-section-content').css('margin-top', '0px'); // Hack for WP 4.4 (at least up to Beta 4) } jQuery('#wx-jumpmenu').css('display', 'none'); //Close the Menu jQuery('.accordion-section').css('width', ''); // clean the hack for Customizer's bad width calculation }; //Below the onlclick open function for Panels, uncollapses if collapsed, switches to customize if in preview mode on small screens function wvrxSelectPanel(tabPanel) { wp.customize.panel(tabPanel).focus(); //Open the clicked panel jQuery('#wx-jumpmenu').css('display', 'none'); //Close the Menu }; //Below the function to open jumpmenu on hover with a delay function wvrxjumpmenuOpen() { function wvrxOpen() { //Check if the mouse is still over when the delay expires if (jQuery('#wx-jump').is(":hover")) { jQuery('#wx-jumpmenu').css('display', 'block'); } } setTimeout(wvrxOpen, 500); }; function wvrxjumpmenuClose() { //For some weird reason, if we dont delay the close, the menu closes when we move from the button to the actual menu Probably a discontinuity issue in the hover function wvrxClose() { if (jQuery('#wx-jump').is(":hover") === false) { jQuery('#wx-jumpmenu').css('display', 'none'); } } setTimeout(wvrxClose, 700); } /* function wvrxRefresh() { alert('refresh'); wp.customize.preview.send( 'refresh' ); } \
\ */ //The section below adds the Menu HTML at the top of the body to place a Menu item on the Top bar jQuery(".customize-panel-description").append(" \ " + wvrxCM.cust_help + ""); jQuery("#customize-header-actions").prepend(" \
 " + wvrxCM.loadingMsg + "
\ \
\   \
\ \ \ \
  • " + wvrxCM.where + " \
      \
    • " + wvrxCM.global_opts + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.global_typo + "
      • \
      • " + wvrxCM.global_spacing + "
      • \
      • " + wvrxCM.site_widths + "
      • \
      •  { }  " + wvrxCM.global_css + "
      • \
      • " + wvrxCM.global_vis + "
      • \
      • " + wvrxCM.images + "
      • \
      • " + wvrxCM.background + "
      • \
      • " + wvrxCM.head_sec + "
      • \
      • " + wvrxCM.links + "
      • \
      \
    • \
    • " + wvrxCM.wrapping + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.site_colors + "
      • \
      • " + wvrxCM.spacing + "
      • \
      • " + wvrxCM.style + "
      • \
      • " + wvrxCM.typography + "
      • \
      •  { }  " + wvrxCM.custom + "
      • \
      \
    • \
    • " + wvrxCM.header + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.site_colors + "
      • \
      • " + wvrxCM.spacing + "
      • \
      • " + wvrxCM.style + "
      • \
      • " + wvrxCM.typography + "
      • \
      • " + wvrxCM.visibility + "
      • \
      • " + wvrxCM.layout + "
      • \
      • " + wvrxCM.images + "
      • \
      • " + wvrxCM.added_content + "
      • \
      •  { }  " + wvrxCM.custom + "
      • \
      \
    • \
    • " + wvrxCM.menus + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.site_colors + "
      • \
      • " + wvrxCM.spacing + "
      • \
      • " + wvrxCM.style + "
      • \
      • " + wvrxCM.typography + "
      • \
      • " + wvrxCM.visibility + "
      • \
      • " + wvrxCM.layout + "
      • \
      • " + wvrxCM.added_content + "
      • \
      •  { }  " + wvrxCM.custom + "
      • \
      \
    • \
    • " + wvrxCM.info_bar + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.site_colors + "
      • \
      • " + wvrxCM.spacing + "
      • \
      • " + wvrxCM.style + "
      • \
      • " + wvrxCM.typography + "
      • \
      • " + wvrxCM.visibility + "
      • \
      •  { }  " + wvrxCM.custom + "
      • \
      \
    • \
    • " + wvrxCM.content + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.site_colors + "
      • \
      • " + wvrxCM.spacing + "
      • \
      • " + wvrxCM.style + "
      • \
      • " + wvrxCM.typography + "
      • \
      • " + wvrxCM.visibility + "
      • \
      • " + wvrxCM.layout + "
      • \
      • " + wvrxCM.images + "
      • \
      •  { }  " + wvrxCM.custom + "
      • \
      \
    • \
    • " + wvrxCM.post_specific + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.site_colors + "
      • \
      • " + wvrxCM.spacing + "
      • \
      • " + wvrxCM.style + "
      • \
      • " + wvrxCM.typography + "
      • \
      • " + wvrxCM.visibility + "
      • \
      • " + wvrxCM.layout + "
      • \
      • " + wvrxCM.images + "
      • \
      • " + wvrxCM.added_content + "
      • \
      •  { }  " + wvrxCM.custom + "
      • \
      \
    • \
    • " + wvrxCM.sidebars + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.site_colors + "
      • \
      • " + wvrxCM.spacing + "
      • \
      • " + wvrxCM.style + "
      • \
      • " + wvrxCM.typography + "
      • \
      • " + wvrxCM.visibility + "
      • \
      • " + wvrxCM.layout + "
      • \
      • " + wvrxCM.added_content + "
      • \
      •  { }  " + wvrxCM.custom + "
      • \
      \
    • \
    • " + wvrxCM.widgets + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.style + "
      • \
      • " + wvrxCM.typography + "
      • \
      •  { }  " + wvrxCM.custom + "
      • \
      \
    • \
    • " + wvrxCM.footer + " \ \
    • \
    • " + wvrxCM.html_inject + "
    • \
    • " + wvrxCM.wp_settings + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.tagline + "
      • \
      • " + wvrxCM.front_page + "
      • \
      • " + wvrxCM.sb_widg_content + "
      • \
      • " + wvrxCM.custom_menus + "
      • \
      • " + wvrxCM.header_image + "
      • \
      • " + wvrxCM.background_image + "
      • \
      \
    • \
    • " + wvrxCM.global_admin + " \
        \
      • " + wvrxCM.what + "
      • \
      • " + wvrxCM.intro + "
      • \
      • " + wvrxCM.subtheme + "
      • \
      • " + wvrxCM.help + "
      • \
      •  { }  " + wvrxCM.help_custom + "
      • \
      • " + wvrxCM.general_admin + "
      • \
      • " + wvrxCM.save_settings + "
      • \
      • " + wvrxCM.restore_settings + "
      • \
      • " + wvrxCM.general_saverestore + "
      • \
      \
    • \
    \
  • \ \ \ \
  • " + wvrxCM.what + " \
      \ \
    • " + wvrxCM.starting + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.intro + "
      • \
      • " + wvrxCM.subtheme + "
      • \
      • " + wvrxCM.help + "
      • \
      \
    • \ \
    • " + wvrxCM.general + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.tagline + "
      • \
      • " + wvrxCM.front_page + "
      • \
      • " + wvrxCM.options_level + "
      • \
      • " + wvrxCM.general_admin + "
      • \
      • " + wvrxCM.save_settings + "
      • \
      • " + wvrxCM.restore_settings + "
      • \
      • " + wvrxCM.general_saverestore + "
      • \
      \
    • \ \
    • " + wvrxCM.layout + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.site_widths + "
      • \
      • " + wvrxCM.header + "
      • \
      • " + wvrxCM.menus + "
      • \
      • " + wvrxCM.content + "
      • \
      • " + wvrxCM.post_specific + "
      • \
      • " + wvrxCM.sidebars + "
      • \
      • " + wvrxCM.footer + "
      • \
      \
    • \ \
    • " + wvrxCM.typography + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.global_typo + "
      • \
      • " + wvrxCM.wrapping + "
      • \
      • " + wvrxCM.header + "
      • \
      • " + wvrxCM.menus + "
      • \
      • " + wvrxCM.info_bar + "
      • \
      • " + wvrxCM.content + "
      • \
      • " + wvrxCM.post_specific + "
      • \
      • " + wvrxCM.sidebars + "
      • \
      • " + wvrxCM.widgets + "
      • \
      • " + wvrxCM.footer + "
      • \
      \
    • \ \
    • " + wvrxCM.images + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.wrapping + "
      • \
      • " + wvrxCM.header + "
      • \
      • " + wvrxCM.content + "
      • \
      • " + wvrxCM.post_specific + "
      • \
      • " + wvrxCM.background + "
      • \
      • " + wvrxCM.header_image + "
      • \
      • " + wvrxCM.background_image + "
      • \
      \
    • \ \
    • " + wvrxCM.visibility + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.global_vis + "
      • \
      • " + wvrxCM.header + "
      • \
      • " + wvrxCM.menus + "
      • \
      • " + wvrxCM.info_bar + "
      • \
      • " + wvrxCM.content + "
      • \
      • " + wvrxCM.post_specific + "
      • \
      • " + wvrxCM.sidebars + "
      • \
      • " + wvrxCM.footer + "
      • \
      \
    • \ \
    • " + wvrxCM.site_colors + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.wrapping + "
      • \
      • " + wvrxCM.links + "
      • \
      • " + wvrxCM.header + "
      • \
      • " + wvrxCM.menus + "
      • \
      • " + wvrxCM.info_bar + "
      • \
      • " + wvrxCM.content + "
      • \
      • " + wvrxCM.post_specific + "
      • \
      • " + wvrxCM.sidebars + "
      • \
      • " + wvrxCM.widgets + "
      • \
      • " + wvrxCM.footer + "
      • \
      \
    • \ \
    • " + wvrxCM.spacing + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.global_spacing + "
      • \
      • " + wvrxCM.wrapping + "
      • \
      • " + wvrxCM.header + "
      • \
      • " + wvrxCM.menus + "
      • \
      • " + wvrxCM.info_bar + "
      • \
      • " + wvrxCM.content + "
      • \
      • " + wvrxCM.post_specific + "
      • \
      • " + wvrxCM.sidebars + "
      • \
      • " + wvrxCM.widgets + "
      • \
      • " + wvrxCM.footer + "
      • \
      \
    • \ \
    • " + wvrxCM.style + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.global_style + "
      • \
      • " + wvrxCM.wrapping + "
      • \
      • " + wvrxCM.header + "
      • \
      • " + wvrxCM.menus + "
      • \
      • " + wvrxCM.info_bar + "
      • \
      • " + wvrxCM.content + "
      • \
      • " + wvrxCM.post_specific + "
      • \
      • " + wvrxCM.sidebars + "
      • \
      • " + wvrxCM.widgets + "
      • \
      • " + wvrxCM.footer + "
      • \
      \
    • \ \
    • " + wvrxCM.added_content + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.head_sec + "
      • \
      • " + wvrxCM.header + "
      • \
      • " + wvrxCM.menus + "
      • \
      • " + wvrxCM.post_specific + "
      • \
      • " + wvrxCM.sidebars + "
      • \
      • " + wvrxCM.footer + "
      • \
      • " + wvrxCM.injection + "
      • \
      \
    • \ \
    •  { }  " + wvrxCM.custom + " \
        \
      • " + wvrxCM.where + "
      • \
      • " + wvrxCM.help_custom + "
      • \
      • " + wvrxCM.global + "
      • \
      • " + wvrxCM.wrapping + "
      • \
      • " + wvrxCM.links + "
      • \
      • " + wvrxCM.header + "
      • \
      • " + wvrxCM.menus + "
      • \
      • " + wvrxCM.info_bar + "
      • \
      • " + wvrxCM.content + "
      • \
      • " + wvrxCM.post_specific + "
      • \
      • " + wvrxCM.sidebars + "
      • \
      • " + wvrxCM.widgets + "
      • \
      • " + wvrxCM.footer + "
      • \
      \
    • \ \
    • " + wvrxCM.sb_widg_content + " \
    • \ \
    • " + wvrxCM.custom_menus + " \
    • \
    \
  • \
    \
    "); //This allows people to click and drag the button to a differnt location (good in preview mode) except on touch device where it interferes with the hover/touch jQuery(function() { var weaverx_isTouch = ("ontouchstart" in window) || (navigator.MaxTouchPoints > 0) || (navigator.msMaxTouchPoints > 0); if (weaverx_isTouch == false) { jQuery("#wx-jump").draggable(); } }); //Moving the Preview / customize toggle button to make space for the menu icon jQuery('.customize-controls-preview-toggle').css('left', '110px'); if (jQuery('body.rtl').length) { jQuery('.customize-controls-preview-toggle').css('left', ''); jQuery('.customize-controls-preview-toggle').css('right', '110px'); }