mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-27 15:50:29 +00:00
Merge "Change confirmation behaviour when abandoning template edits"
This commit is contained in:
commit
66c6fa294c
|
@ -218,6 +218,14 @@ ve.ui.MWExtensionWindow.prototype.hasMeaningfulEdits = function () {
|
|||
OO.setProp( mwDataCopy, 'body', 'extsrc', changed.trim() );
|
||||
}
|
||||
|
||||
// Also trim the baseline. In "edit" mode we likely have added whitespace,
|
||||
// and in "insert" mode we don't want to break if the default value starts
|
||||
// or ends with whitespace.
|
||||
const baselineChanged = OO.getProp( mwDataBaseline, 'body', 'extsrc' );
|
||||
if ( baselineChanged !== undefined ) {
|
||||
OO.setProp( mwDataBaseline, 'body', 'extsrc', baselineChanged.trim() );
|
||||
}
|
||||
|
||||
return !ve.compare( mwDataBaseline, mwDataCopy );
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue