mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 21:53:35 +00:00
Make Ace filter editor resizable
Bug: T294856 Change-Id: I9964440a0a1cf9a8ba0514c7db085efd791a3ce0
This commit is contained in:
parent
b9cd2dabf8
commit
b0a38cda68
|
@ -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();
|
||||
} );
|
||||
|
|
Loading…
Reference in a new issue