Make Ace filter editor resizable

Bug: T294856
Change-Id: I9964440a0a1cf9a8ba0514c7db085efd791a3ce0
This commit is contained in:
Jean-Luc Hassec 2023-02-12 22:02:25 +00:00 committed by Samtar
parent b9cd2dabf8
commit b0a38cda68

View file

@ -504,6 +504,18 @@
$plainTextBox.val( filterEditor.getSession().getValue() );
} );
// Make Ace editor resizable
// (uses ResizeObserver, which is not implemented in IE 11)
if ( typeof ResizeObserver !== 'undefined' ) {
// Make the container resizable
$filterBox.css( 'resize', 'both' );
// Refresh Ace editor size (notably its scrollbars) when the container
// is resized, otherwise it would be refreshed only on window resize
new ResizeObserver( function () {
filterEditor.resize();
} ).observe( $filterBox[ 0 ] );
}
$switchEditorBtn.on( 'click', switchEditor );
$switchEditorBtn.show();
} );