Changeset 3344752
- Timestamp:
- 08/14/2025 03:31:43 PM (7 months ago)
- Location:
- responsive-mobile-select-menu/trunk
- Files:
-
- 6 edited
-
assets/js/responsive-menu.js (modified) (4 diffs)
-
readme.md (modified) (2 diffs)
-
readme.txt (modified) (3 diffs)
-
responsive-mobile-select-menu.php (modified) (2 diffs)
-
screenshot-1.png (modified) (previous)
-
screenshot-2.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
responsive-mobile-select-menu/trunk/assets/js/responsive-menu.js
r3344552 r3344752 32 32 this.updateVisibility(); 33 33 34 // Restore saved selections on initial load35 this.restoreAllSelections();36 37 34 this.isInitialized = true; 38 35 } … … 70 67 } 71 68 72 // Save the selected option to localStorage for persistence73 this.saveSelectedOption($select, selectedValue);74 75 69 // Validate URL 76 70 try { 77 71 const url = new URL(selectedValue, window.location.origin); 72 73 // Only save if we're navigating to a different page 74 if (url.href !== window.location.href) { 75 // Save the selected option to localStorage for persistence 76 this.saveSelectedOption($select, selectedValue); 77 } 78 78 79 79 // Navigate to selected page … … 105 105 const $option = $select.find(`option[value="${savedValue}"]`); 106 106 if ($option.length > 0) { 107 $select.val(savedValue); 108 return true; 107 // Check if we're currently on the saved page 108 const currentUrl = window.location.href; 109 if (savedValue === currentUrl) { 110 // We're on the saved page, show it as selected 111 $select.val(savedValue); 112 return true; 113 } else { 114 // We're not on the saved page, clear the selection to show placeholder 115 $select.val(''); 116 // Remove the saved value since we're not on that page anymore 117 localStorage.removeItem(`responsive-menu-selection-${menuId}`); 118 return false; 119 } 109 120 } 110 121 } … … 131 142 // Fallback: use the select's position in the document 132 143 return `select-${$select.index()}`; 133 }134 135 /**136 * Restore all saved selections on initial load137 */138 restoreAllSelections() {139 this.selects.each((index, select) => {140 const $select = $(select);141 this.restoreSelectedOption($select);142 });143 144 } 144 145 -
responsive-mobile-select-menu/trunk/readme.md
r3344552 r3344752 6 6 **Tested up to:** 6.8 7 7 **Requires PHP:** 8.0 8 **Stable tag:** 2.0. 38 **Stable tag:** 2.0.4 9 9 **License:** GPLv2 or later 10 10 **License URI:** https://www.gnu.org/licenses/gpl-2.0.html … … 192 192 ## Changelog 193 193 194 ### 2.0.4 - Dropdown Behavior & User Experience 195 * **Dropdown behavior improvements** - Fixed confusing dropdown state persistence across page navigation 196 * **User experience enhancements** - Dropdown now correctly shows placeholder text on new pages 197 * **Intelligent state management** - Only saves and restores dropdown selection when actually on the target page 198 * **Automatic cleanup** - Removes stale localStorage entries when navigating away from saved pages 199 * **Intuitive navigation** - Dropdown always shows the correct state for the current page 200 194 201 ### 2.0.3 - Critical Bug Fixes & Object Handling 195 202 * **Object handling improvements** - Proper handling of WordPress menu objects and WP_Term instances -
responsive-mobile-select-menu/trunk/readme.txt
r3344552 r3344752 6 6 Tested up to: 6.8 7 7 Requires PHP: 8.0 8 Stable tag: 2.0. 38 Stable tag: 2.0.4 9 9 License: GPLv2 or later 10 10 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 127 127 128 128 == Changelog == 129 130 = 2.0.4 = 131 * **Dropdown behavior improvements** - Fixed confusing dropdown state persistence across page navigation 132 * **User experience enhancements** - Dropdown now correctly shows placeholder text on new pages 133 * **Intelligent state management** - Only saves and restores dropdown selection when actually on the target page 134 * **Automatic cleanup** - Removes stale localStorage entries when navigating away from saved pages 135 * **Intuitive navigation** - Dropdown always shows the correct state for the current page 129 136 130 137 = 2.0.3 = … … 209 216 == Upgrade Notice == 210 217 218 = 2.0.4 = 219 This is a user experience improvement release that fixes confusing dropdown behavior across page navigation. The update includes intelligent state management, automatic cleanup of stale selections, and ensures the dropdown always shows the correct state for the current page. Recommended for all users. 220 211 221 = 2.0.3 = 212 222 This is a critical bug fix release that resolves fatal errors caused by WordPress menu object handling issues. The update includes proper WP_Term object conversion, enhanced error handling, and fixes dropdown visibility problems. Strongly recommended for all users. -
responsive-mobile-select-menu/trunk/responsive-mobile-select-menu.php
r3344552 r3344752 4 4 * Plugin URI: https://www.saskialund.de/responsive-mobile-select-menu/ 5 5 * Description: Mobile Menu Made Simple - Automatically converts your WordPress menu into a touch-friendly dropdown on mobile devices. No theme modifications needed. 6 * Version: 2.0. 36 * Version: 2.0.4 7 7 * Requires at least: 6.5 8 8 * Tested up to: 6.8 … … 24 24 25 25 // Plugin-Konstanten. 26 define( 'RESPONSIVE_MOBILE_SELECT_VERSION', '2.0. 3' );26 define( 'RESPONSIVE_MOBILE_SELECT_VERSION', '2.0.4' ); 27 27 define( 'RESPONSIVE_MOBILE_SELECT_PLUGIN_FILE', __FILE__ ); 28 28 define( 'RESPONSIVE_MOBILE_SELECT_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset
for help on using the changeset viewer.