Changeset 12408
- Timestamp:
- 02/20/2023 06:24:22 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/plugins/gp-translation-helpers/js/editor.js
r12405 r12408 12 12 } ); 13 13 14 // When a new translation row is opened (with double click), the tabs 15 // (header tab and content) for this row are updated with the Ajax query. 16 $gp.editor.table.on( 'dblclick', 'tr.preview td', function() { 17 loadTabsAndDivs( $( this ) ); 18 } ); 19 20 // When a new translation row is opened (clicking in the "Details" button), the 21 // tabs (header tab and content) for this row are updated with the Ajax query. 22 $gp.editor.table.on( 'click', '.action.edit', function( ) { 23 loadTabsAndDivs( $( this ) ); 14 // When a new translation row is opened (with double click, clicking in the "Details" button, 15 // or with the hotkeys), the translation textarea is focused, so the tabs (header tabs and 16 // divs with the content) for the right sidebar are updated. 17 $gp.editor.table.on( 'focus input', 'tr.editor textarea.foreign-text', function() { 18 var tr = $( this ).closest( 'tr.editor' ); 19 loadTabsAndDivs( tr ); 24 20 } ); 25 21 … … 203 199 */ 204 200 function loadTabsAndDivs( element ) { 205 var originalId = element.closest( 'tr' ).attr( 'id' ).substring( 8);201 var originalId = element.closest( 'tr' ).attr( 'id' ).substring( 7 ); 206 202 var requestUrl = $gp_translation_helpers_editor.translation_helper_url + originalId + '?nohc'; 207 203 $.getJSON( requestUrl, function( data ) {
Note: See TracChangeset
for help on using the changeset viewer.