Skip to content

Commit 7c00ac0

Browse files
committed
Update editable build
1 parent 6139a38 commit 7c00ac0

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

editable.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5004,10 +5004,10 @@ module.exports = function (editable) {
50045004
* @event clipboard
50055005
* @param {HTMLElement} element The element triggering the event.
50065006
* @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.
50085008
*/
5009-
clipboard: function(element, action, cursor) {
5010-
behavior.clipboard(element, action, cursor);
5009+
clipboard: function(element, action, selection) {
5010+
behavior.clipboard(element, action, selection);
50115011
},
50125012

50135013
/**
@@ -5394,10 +5394,16 @@ Dispatcher.prototype.setupElementEvents = function() {
53945394
if (this.getAttribute(config.pastingAttribute)) return;
53955395
_this.notify('blur', this);
53965396
}).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+
}
53985401
}).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+
}
54015407
}).on('paste.editable', _this.editableSelector, function(event) {
54025408
var element = this;
54035409
var afterPaste = function (blocks, cursor) {

0 commit comments

Comments
 (0)