mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-12 00:58:44 +00:00
Merge "ve.ui.MWEditSummaryWidget: Use built-in 'allowLinebreaks' option"
This commit is contained in:
commit
aac7f99742
|
@ -24,7 +24,7 @@
|
|||
"license-name": "MIT",
|
||||
"type": "editor",
|
||||
"requires": {
|
||||
"MediaWiki": ">= 1.41"
|
||||
"MediaWiki": ">= 1.42"
|
||||
},
|
||||
"callback": "MediaWiki\\Extension\\VisualEditor\\Hooks::onRegistration",
|
||||
"ServiceWiringFiles": [
|
||||
|
|
|
@ -23,10 +23,7 @@ ve.ui.MWEditSummaryWidget = function VeUiMWEditSummaryWidget( config ) {
|
|||
ve.ui.MWEditSummaryWidget.super.call( this, ve.extendObject( {
|
||||
autosize: true,
|
||||
maxRows: 15,
|
||||
inputFilter: function ( value ) {
|
||||
// Prevent the user from inputting newlines (this kicks in on paste, etc.)
|
||||
return value.replace( /\r?\n/g, ' ' );
|
||||
}
|
||||
allowLinebreaks: false
|
||||
}, config ) );
|
||||
|
||||
// Mixin method
|
||||
|
@ -131,19 +128,6 @@ ve.ui.MWEditSummaryWidget.prototype.adjustSize = function () {
|
|||
return this;
|
||||
};
|
||||
|
||||
/**
|
||||
* @inheritdoc
|
||||
*/
|
||||
ve.ui.MWEditSummaryWidget.prototype.onKeyPress = function ( e ) {
|
||||
if ( e.which === OO.ui.Keys.ENTER ) {
|
||||
e.preventDefault();
|
||||
}
|
||||
// Grand-parent method
|
||||
// Multi-line only fires 'enter' on ctrl+enter, but this should
|
||||
// fire on plain enter as it behaves like a single line input.
|
||||
OO.ui.TextInputWidget.prototype.onKeyPress.call( this, e );
|
||||
};
|
||||
|
||||
/**
|
||||
* Get recent edit summaries for the logged in user
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue