clipboard: fix paste event; dont pass data with events
This commit is contained in:
parent
99672fc039
commit
8202aaa6e1
1 changed files with 4 additions and 4 deletions
|
@ -30,7 +30,7 @@ Ox.Clipboard = function() {
|
|||
items: Ox.unique(clipboard.items.concat(items)),
|
||||
type: type
|
||||
};
|
||||
$element && $element.triggerEvent('add', clipboard);
|
||||
$element && $element.triggerEvent('add');
|
||||
}
|
||||
return clipboard.items.length;
|
||||
},
|
||||
|
@ -42,14 +42,14 @@ Ox.Clipboard = function() {
|
|||
},
|
||||
clear: function() {
|
||||
clipboard = {items: [], type: void 0};
|
||||
$element && $element.triggerEvent('clear', clipboard);
|
||||
$element && $element.triggerEvent('clear');
|
||||
return clipboard.items.length;
|
||||
},
|
||||
copy: function(items, type) {
|
||||
items = Ox.makeArray(items);
|
||||
if (items.length) {
|
||||
clipboard = {items: items, type: type};
|
||||
$element && $element.triggerEvent('copy', clipboard);
|
||||
$element && $element.triggerEvent('copy');
|
||||
}
|
||||
return clipboard.items.length;
|
||||
},
|
||||
|
@ -57,8 +57,8 @@ Ox.Clipboard = function() {
|
|||
return !type || type == clipboard.type ? clipboard.items.length : 0;
|
||||
},
|
||||
paste: function(type) {
|
||||
$element && $element.triggerEvent('paste');
|
||||
return !type || type == clipboard.type ? clipboard.items : [];
|
||||
$element && $element.triggerEvent('paste', clipboard);
|
||||
},
|
||||
type: function() {
|
||||
return clipboard.type;
|
||||
|
|
Loading…
Reference in a new issue