mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-29 00:30:44 +00:00
ce.MWWikitextSurface#onCopy: Do nothing if selection is empty
Bug: T179920 Change-Id: I3400f8277a4de6bac216ecbc0ba0d46670e03d11
This commit is contained in:
parent
3713b7741d
commit
1cf2bf4a67
|
@ -35,6 +35,10 @@ ve.ce.MWWikitextSurface.prototype.onCopy = function ( e ) {
|
|||
clipboardData = e.originalEvent.clipboardData,
|
||||
text = this.getModel().getFragment().getText( true ).replace( /\n\n/g, '\n' );
|
||||
|
||||
if ( !text ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ( clipboardData ) {
|
||||
// Disable the default event so we can override the data
|
||||
e.preventDefault();
|
||||
|
|
Loading…
Reference in a new issue