File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 77 * This snippet is designed to be used with the Gravity Forms Code Chest plugin.
88 * https://gravitywiz.com/gravity-forms-code-chest/
99 */
10+ const pageNameTemplate = 'Step {pageNumber}: {pageName}' ;
1011function updateNavigationState ( ) {
1112 // hide if visible
1213 $ ( '#gf_page_steps_GFFORMID' ) . attr ( 'hidden' , 'true' ) ;
@@ -33,10 +34,15 @@ function updateNavigationState( ) {
3334 }
3435
3536 $ ( '#gf_page_steps_GFFORMID .gf_step' ) . each ( function ( ) {
36- var $div = $ ( this ) ;
37+ var $div = $ ( this ) ;
3738 var stepNumber = $div . find ( '.gf_step_number' ) . text ( ) ;
38- var $a = $div . find ( 'a' ) ;
39- var $option = $ ( '<option></option>' ) . text ( 'Step ' + stepNumber ) ;
39+ var pageName = $div . find ( '.gf_step_label' ) . text ( ) . trim ( ) ;
40+ var optionText = pageNameTemplate
41+ . replace ( '{pageNumber}' , stepNumber )
42+ . replace ( '{pageName}' , pageName ) ;
43+
44+ var $a = $div . find ( 'a' ) ;
45+ var $option = $ ( '<option></option>' ) . text ( optionText ) ;
4046
4147 if ( $a . length > 0 ) {
4248 // found a tag, add the link to the dropdown option
You can’t perform that action at this time.
0 commit comments