Changeset 47829
- Timestamp:
- 05/19/2020 10:48:49 PM (4 years ago)
- Location:
- branches/5.4
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.4
-
branches/5.4/src/wp-content/themes/twentytwenty/assets/js/index.js
r47122 r47829 137 137 var target = event.target; 138 138 var modal = document.querySelector( '.cover-modal.active' ); 139 140 // if target onclick is <a> with # within the href attribute 141 if ( event.target.tagName.toLowerCase() === 'a' && event.target.hash.includes( '#' ) && modal !== null ) { 142 // untoggle the modal 143 this.untoggleModal( modal ); 144 // wait 550 and scroll to the anchor 145 setTimeout( function() { 146 var anchor = document.getElementById( event.target.hash.slice( 1 ) ); 147 anchor.scrollIntoView(); 148 }, 550 ); 149 } 139 150 140 151 if ( target === modal ) {
Note: See TracChangeset
for help on using the changeset viewer.