Changeset 40064
- Timestamp:
- 02/16/2017 09:20:45 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/js/customize-preview.js
r39584 r40064 146 146 } 147 147 148 // Allow internal jump links and JS links to behave normally without preventing default. 148 149 isInternalJumpLink = ( '#' === link.attr( 'href' ).substr( 0, 1 ) ); 149 150 // Allow internal jump links to behave normally without preventing default. 151 if ( isInternalJumpLink ) { 150 if ( isInternalJumpLink || ! /^https?:$/.test( link.prop( 'protocol' ) ) ) { 152 151 return; 153 152 } … … 335 334 } 336 335 337 // Ignore links with href="#" or href="#id".338 if ( '#' === $( element ).attr( 'href' ).substr( 0, 1 ) ) {336 // Ignore links with href="#", href="#id", or non-HTTP protocols (e.g. javascript: and mailto:). 337 if ( '#' === $( element ).attr( 'href' ).substr( 0, 1 ) || ! /^https?:$/.test( element.protocol ) ) { 339 338 return; 340 339 }
Note: See TracChangeset
for help on using the changeset viewer.