Ticket #4519: 4519.diff
File 4519.diff, 1.7 KB (added by , 4 years ago) |
---|
-
client/components/plugin/sections/faq/style.scss
43 43 outline: none; 44 44 } 45 45 } 46 h3 { 47 display: inline; 48 text-transform: none; 49 margin-top: 0; 50 margin-bottom: 0; 51 color: $color__link; 52 text-decoration: underline; 53 button { 54 all: inherit; 55 } 56 } 57 46 58 } 47 59 48 60 dd { -
js/section-faq.js
4 4 questions 5 5 .each( function( index, question ) { 6 6 var $question = $( question ), 7 $button = $( '<a href="#" />' ), 7 $button = $( '<button />' ), 8 $h3 = $( '<h3 />' ), 8 9 id = $question.attr( 'id' ); 9 10 10 11 // If there is no ID, create our own. … … 13 14 $question.attr( 'id', id ); 14 15 } 15 16 16 $button.attr( ' href', id ).on( 'click', function( event ) {17 $button.attr( 'formaction', id ).on( 'click', function( event ) { 17 18 event.preventDefault(); 19 window.location.hash = id; 18 20 } ); 19 21 20 $question.html( $ button.text( $question.text() ) );22 $question.html( $h3.html( $button.text( $question.text() ) ) ); 21 23 } ) 22 24 .on( 'click', function( event ) { 23 25 var $question = $( event.currentTarget ); … … 40 42 } ); 41 43 42 44 if ( window.location.hash ) { 43 questions.find( '[ href="' + window.location.hash + '"]' ).trigger( 'click' );45 questions.find( '[formaction="' + window.location.hash + '"]' ).trigger( 'click' ); 44 46 } 45 47 } )( jQuery );