diff --git a/commons-extension-webapp/src/main/webapp/ckeditor/plugins/copyformatting/plugin.js b/commons-extension-webapp/src/main/webapp/ckeditor/plugins/copyformatting/plugin.js index e4d33e8844..ea42af735f 100644 --- a/commons-extension-webapp/src/main/webapp/ckeditor/plugins/copyformatting/plugin.js +++ b/commons-extension-webapp/src/main/webapp/ckeditor/plugins/copyformatting/plugin.js @@ -109,6 +109,15 @@ } } ); + if (mouseupHost === editor.document) { + editable.attachListener( editable, 'mouseup', function( evt ) { + // Apply formatting only if any styles are copied (#2780, #2655, #2470). + if ( getMouseButton( evt ) === CKEDITOR.MOUSE_BUTTON_LEFT && cmd.state === CKEDITOR.TRISTATE_ON ) { + editor.execCommand( 'applyFormatting' ); + } + } ); + } + editable.attachListener( CKEDITOR.document, 'mouseup', function( evt ) { if ( getMouseButton( evt ) === CKEDITOR.MOUSE_BUTTON_LEFT && cmd.state === CKEDITOR.TRISTATE_ON && !editable.contains( evt.data.getTarget() ) ) {