@@ -5004,10 +5004,10 @@ module.exports = function (editable) {
5004
5004
* @event clipboard
5005
5005
* @param {HTMLElement } element The element triggering the event.
5006
5006
* @param {String } action The clipboard action: "copy" or "cut".
5007
- * @param {Cursor } cursor The actual cursor object.
5007
+ * @param {Selection } selection A selection object around the copied content .
5008
5008
*/
5009
- clipboard : function ( element , action , cursor ) {
5010
- behavior . clipboard ( element , action , cursor ) ;
5009
+ clipboard : function ( element , action , selection ) {
5010
+ behavior . clipboard ( element , action , selection ) ;
5011
5011
} ,
5012
5012
5013
5013
/**
@@ -5394,10 +5394,16 @@ Dispatcher.prototype.setupElementEvents = function() {
5394
5394
if ( this . getAttribute ( config . pastingAttribute ) ) return ;
5395
5395
_this . notify ( 'blur' , this ) ;
5396
5396
} ) . on ( 'copy.editable' , _this . editableSelector , function ( event ) {
5397
- _this . notify ( 'clipboard' , this , 'copy' , _this . selectionWatcher . getFreshSelection ( ) ) ;
5397
+ var selection = _this . selectionWatcher . getFreshSelection ( ) ;
5398
+ if ( selection . isSelection ) {
5399
+ _this . notify ( 'clipboard' , this , 'copy' , selection ) ;
5400
+ }
5398
5401
} ) . on ( 'cut.editable' , _this . editableSelector , function ( event ) {
5399
- _this . notify ( 'clipboard' , this , 'cut' , _this . selectionWatcher . getFreshSelection ( ) ) ;
5400
- _this . triggerChangeEvent ( this ) ;
5402
+ var selection = _this . selectionWatcher . getFreshSelection ( ) ;
5403
+ if ( selection . isSelection ) {
5404
+ _this . notify ( 'clipboard' , this , 'cut' , selection ) ;
5405
+ _this . triggerChangeEvent ( this ) ;
5406
+ }
5401
5407
} ) . on ( 'paste.editable' , _this . editableSelector , function ( event ) {
5402
5408
var element = this ;
5403
5409
var afterPaste = function ( blocks , cursor ) {
0 commit comments