mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/CodeMirror
synced 2024-11-23 22:03:28 +00:00
Remove dependency on jquery.ui from CodeMirror
Now that RTP has been enabled for a while, we no longer need this and jquery.ui is deprecated. Bug: T323329 Change-Id: Idbb92bd4f18e2c6e0adc51d1a3fa909efc129686
This commit is contained in:
parent
d9ec236217
commit
fbf02b1dc2
|
@ -62,7 +62,6 @@
|
|||
"jquery.textSelection",
|
||||
"mediawiki.user",
|
||||
"user.options",
|
||||
"jquery.ui",
|
||||
"oojs-ui.styles.icons-editing-styling"
|
||||
],
|
||||
"packageFiles": [
|
||||
|
|
|
@ -102,22 +102,10 @@ function init() {
|
|||
function setupSizing() {
|
||||
var $codeMirror = $( codeMirror.getWrapperElement() );
|
||||
|
||||
// Only add jQuery UI's resizing corner if realtime preview is not enabled,
|
||||
// Only add resizing corner if realtime preview is enabled,
|
||||
// because that feature provides height resizing (even when preview isn't used).
|
||||
if ( mw.loader.getState( 'ext.wikiEditor.realtimepreview' ) === 'ready' ) {
|
||||
codeMirror.setSize( '100%', $textbox1.parent().height() );
|
||||
} else {
|
||||
// RL module jquery.ui
|
||||
// eslint-disable-next-line es-x/no-resizable-and-growable-arraybuffers
|
||||
$codeMirror.resizable( {
|
||||
handles: 'se',
|
||||
resize: function () {
|
||||
// Keep at 100% parent width, don't modify height here
|
||||
codeMirror.setSize( '100%', null );
|
||||
}
|
||||
} );
|
||||
// Match the height of the textarea.
|
||||
codeMirror.setSize( null, $textbox1.height() );
|
||||
}
|
||||
var $resizableHandle = $codeMirror.find( '.ui-resizable-handle' );
|
||||
mw.hook( 'ext.WikiEditor.realtimepreview.enable' ).add( function ( realtimePreview ) {
|
||||
|
|
Loading…
Reference in a new issue