Plugin Directory

Changeset 3344752


Ignore:
Timestamp:
08/14/2025 03:31:43 PM (7 months ago)
Author:
Jyria
Message:

trunk Version 2.0.4

Location:
responsive-mobile-select-menu/trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • responsive-mobile-select-menu/trunk/assets/js/responsive-menu.js

    r3344552 r3344752  
    3232            this.updateVisibility();
    3333           
    34             // Restore saved selections on initial load
    35             this.restoreAllSelections();
    36            
    3734            this.isInitialized = true;
    3835        }
     
    7067            }
    7168
    72             // Save the selected option to localStorage for persistence
    73             this.saveSelectedOption($select, selectedValue);
    74 
    7569            // Validate URL
    7670            try {
    7771                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                }
    7878               
    7979                // Navigate to selected page
     
    105105                    const $option = $select.find(`option[value="${savedValue}"]`);
    106106                    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                        }
    109120                    }
    110121                }
     
    131142            // Fallback: use the select's position in the document
    132143            return `select-${$select.index()}`;
    133         }
    134 
    135         /**
    136          * Restore all saved selections on initial load
    137          */
    138         restoreAllSelections() {
    139             this.selects.each((index, select) => {
    140                 const $select = $(select);
    141                 this.restoreSelectedOption($select);
    142             });
    143144        }
    144145
  • responsive-mobile-select-menu/trunk/readme.md

    r3344552 r3344752  
    66**Tested up to:** 6.8 
    77**Requires PHP:** 8.0 
    8 **Stable tag:** 2.0.3 
     8**Stable tag:** 2.0.4 
    99**License:** GPLv2 or later 
    1010**License URI:** https://www.gnu.org/licenses/gpl-2.0.html 
     
    192192## Changelog
    193193
     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
    194201### 2.0.3 - Critical Bug Fixes & Object Handling
    195202* **Object handling improvements** - Proper handling of WordPress menu objects and WP_Term instances
  • responsive-mobile-select-menu/trunk/readme.txt

    r3344552 r3344752  
    66Tested up to: 6.8
    77Requires PHP: 8.0
    8 Stable tag: 2.0.3
     8Stable tag: 2.0.4
    99License: GPLv2 or later
    1010License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    127127
    128128== 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
    129136
    130137= 2.0.3 =
     
    209216== Upgrade Notice ==
    210217
     218= 2.0.4 =
     219This 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
    211221= 2.0.3 =
    212222This 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  
    44 * Plugin URI: https://www.saskialund.de/responsive-mobile-select-menu/
    55 * 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.3
     6 * Version: 2.0.4
    77 * Requires at least: 6.5
    88 * Tested up to: 6.8
     
    2424
    2525// Plugin-Konstanten.
    26 define( 'RESPONSIVE_MOBILE_SELECT_VERSION', '2.0.3' );
     26define( 'RESPONSIVE_MOBILE_SELECT_VERSION', '2.0.4' );
    2727define( 'RESPONSIVE_MOBILE_SELECT_PLUGIN_FILE', __FILE__ );
    2828define( 'RESPONSIVE_MOBILE_SELECT_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
Note: See TracChangeset for help on using the changeset viewer.