ce.MWWikitextSurface#onCopy: Do nothing if selection is empty

Bug: T179920
Change-Id: I3400f8277a4de6bac216ecbc0ba0d46670e03d11
This commit is contained in:
Ed Sanders 2017-11-07 15:35:14 +00:00 committed by Jforrester
parent 3713b7741d
commit 1cf2bf4a67

View file

@ -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();