| @@ -68,13 +68,9 @@ | ||
| 68 | 68 | <?php esc_html_e('Payments', 'fluentform'); ?><span class="ff_new_badge">new</span> |
| 69 | 69 | </a> |
| 70 | 70 | <?php endif; ?> |
| 71 | 71 | </li> |
| 72 | - <li class="<?php echo ($page == 'fluent_forms_smtp') ? 'active' : '' ?>"> | |
| 73 | - <?php if(!defined('FLUENT_MAIL') && !defined('FLUENTFORMPRO')): ?> | |
| 74 | - <a class="ff_menu_link" href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms_smtp')); ?>">SMTP</a> | |
| 75 | - <?php endif; ?> | |
| 76 | - </li> | |
| 72 | + | |
| 77 | 73 | <li class="<?php echo ($page == 'fluent_forms_docs') ? 'active' : '' ?>"> |
| 78 | 74 | <a href="<?php echo esc_url(admin_url('admin.php?page=fluent_forms_docs')); ?>" class="ff_menu_link"> |
| 79 | 75 | <?php esc_html_e('Support', 'fluentform'); ?> |
| 80 | 76 | </a> |
| @@ -80,9 +76,9 @@ | ||
| 80 | 76 | </a> |
| 81 | 77 | </li> |
| 82 | 78 | <?php if(!defined('FLUENTFORMPRO')): ?> |
| 83 | 79 | <li> |
| 84 | - <a target="_blank" rel="noopener" href="<?php echo esc_url(fluentform_upgrade_url()); ?>" class="ff_menu_link ff_menu_link_buy"> | |
| 80 | + <a target="_blank" rel="noopener" href="<?php echo esc_url(fluentform_upgrade_url('top_bar')); ?>" class="ff_menu_link ff_menu_link_buy"> | |
| 85 | 81 | <?php esc_html_e('Upgrade to Pro', 'fluentform'); ?> |
| 86 | 82 | </a> |
| 87 | 83 | </li> |
| 88 | 84 | <?php endif; ?> |
| @@ -128,18 +124,62 @@ | ||
| 128 | 124 | |
| 129 | 125 | $globalSearchButtonClickScript |
| 130 | 126 | |
| 131 | 127 | // for setting sidebar |
| 132 | - let globalSettingSidebarElem = jQuery('.ff_settings_sidebar_wrap'); | |
| 128 | + let globalSettingSidebarElem = jQuery('#ff_global_settings_sidebar'); | |
| 133 | 129 | let globalOverlayElem = jQuery('#global-overlay'); |
| 130 | + let globalSettingSidebarStateKey = 'fluentform_global_settings_sidebar_collapsed'; | |
| 131 | + let globalSettingSidebarToggle = globalSettingSidebarElem.find('.ff_sidebar_toggle'); | |
| 132 | + let isGlobalSettingDesktop = function() { | |
| 133 | + return window.matchMedia('(min-width: 769px)').matches; | |
| 134 | + }; | |
| 135 | + let syncGlobalSettingSidebarMode = function() { | |
| 136 | + if (isGlobalSettingDesktop() && window.localStorage.getItem(globalSettingSidebarStateKey) === 'yes') { | |
| 137 | + globalSettingSidebarElem.addClass('ff_settings_sidebar_collapsed'); | |
| 138 | + } else if (!isGlobalSettingDesktop()) { | |
| 139 | + globalSettingSidebarElem.removeClass('ff_settings_sidebar_collapsed'); | |
| 140 | + } | |
| 141 | + }; | |
| 142 | + let updateGlobalSettingToggleState = function() { | |
| 143 | + let collapseLabel = globalSettingSidebarToggle.data('collapse-label') || 'Collapse settings menu'; | |
| 144 | + let expandLabel = globalSettingSidebarToggle.data('expand-label') || 'Expand settings menu'; | |
| 145 | + let isExpanded = isGlobalSettingDesktop() | |
| 146 | + ? !globalSettingSidebarElem.hasClass('ff_settings_sidebar_collapsed') | |
| 147 | + : globalSettingSidebarElem.hasClass('active'); | |
| 134 | 148 | |
| 135 | - jQuery('.ff_sidebar_toggle').on('click', function() { | |
| 149 | + globalSettingSidebarToggle | |
| 150 | + .attr('aria-expanded', isExpanded ? 'true' : 'false') | |
| 151 | + .attr('aria-label', isExpanded ? collapseLabel : expandLabel) | |
| 152 | + .attr('title', isExpanded ? collapseLabel : expandLabel); | |
| 153 | + }; | |
| 154 | + | |
| 155 | + syncGlobalSettingSidebarMode(); | |
| 156 | + | |
| 157 | + globalSettingSidebarToggle.on('click', function() { | |
| 158 | + if (isGlobalSettingDesktop()) { | |
| 159 | + globalSettingSidebarElem.toggleClass('ff_settings_sidebar_collapsed'); | |
| 160 | + window.localStorage.setItem( | |
| 161 | + globalSettingSidebarStateKey, | |
| 162 | + globalSettingSidebarElem.hasClass('ff_settings_sidebar_collapsed') ? 'yes' : 'no' | |
| 163 | + ); | |
| 164 | + updateGlobalSettingToggleState(); | |
| 165 | + return; | |
| 166 | + } | |
| 167 | + | |
| 136 | 168 | jQuery(globalSettingSidebarElem).add(globalOverlayElem).toggleClass('active'); |
| 169 | + updateGlobalSettingToggleState(); | |
| 137 | 170 | }); |
| 138 | - | |
| 171 | + | |
| 139 | 172 | jQuery(globalOverlayElem).on('click', function() { |
| 140 | 173 | jQuery(globalOverlayElem).add(globalSettingSidebarElem).removeClass('active'); |
| 174 | + updateGlobalSettingToggleState(); | |
| 141 | 175 | }); |
| 176 | + | |
| 177 | + jQuery(window).on('resize', function() { | |
| 178 | + syncGlobalSettingSidebarMode(); | |
| 179 | + updateGlobalSettingToggleState(); | |
| 180 | + }); | |
| 181 | + updateGlobalSettingToggleState(); | |
| 142 | 182 | |
| 143 | 183 | "); |
| 144 | 184 | ?> |
| 145 | 185 | </div> |