Changeset 42012
- Timestamp:
- 10/24/2017 11:26:38 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/js/common.js
r41598 r42012 248 248 selectionEnd = $permalinkStructure[ 0 ].selectionEnd, 249 249 textToAppend = $( this ).text().trim(), 250 textToAnnounce = $( this ).attr( 'data-added' ); 250 textToAnnounce = $( this ).attr( 'data-added' ), 251 newSelectionStart; 251 252 252 253 // Remove structure tag if already part of the structure. … … 289 290 // Disable button. 290 291 changeStructureTagButtonState( $( this ) ); 292 293 // If input had focus give it back with cursor right after appended text. 294 if ( permalinkStructureFocused && $permalinkStructure[0].setSelectionRange ) { 295 newSelectionStart = ( permalinkStructureValue.substr( 0, selectionStart ) + textToAppend ).length; 296 $permalinkStructure[0].setSelectionRange( newSelectionStart, newSelectionStart ); 297 $permalinkStructure.focus(); 298 } 291 299 } ); 292 300
Note: See TracChangeset
for help on using the changeset viewer.