Changeset 9391
- Timestamp:
- 01/11/2020 01:38:37 AM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-developer/js/user-notes-preview.js
r9390 r9391 6 6 ( function( $ ) { 7 7 8 var textarea, t extareaHeight, text, preview, previewContent, tabs, processing, spinner;8 var textarea, tabContentHeight, text, preview, previewContent, tabs, processing, spinner; 9 9 10 10 function init() { … … 46 46 tabs.on( "keydown.note_preview, click.note_preview", function( e ) { 47 47 48 // Preview tab should be at least as tall input tab to prevent resizing wonkiness. 49 tabContentHeight = $( '#comment-form-comment' ).outerHeight( false ); 50 51 if ( 0 < tabContentHeight ) { 52 preview.css( 'min-height', tabContentHeight + 'px' ); 53 } 54 48 55 if ( 'comment-preview' === $( this ).attr( 'aria-controls' ) ) { 49 56 … … 69 76 textarea.focus(); 70 77 } 71 } );72 73 // Set preview heigth when the textarea is visible74 $( '.table-of-contents a[href="#add-note-or-feedback"]' ).click( function( e ) {75 e.preventDefault();76 tabs.parents( '.tablist' ).show();77 setTimeout( function() {78 textareaHeight = textarea.outerHeight( true );79 if ( 0 < textareaHeight ) {80 preview.css( 'min-height', textareaHeight + 'px' );81 }82 }, 500 );83 78 } ); 84 79 }
Note: See TracChangeset
for help on using the changeset viewer.