Ox.Clipboard: allow for copying/adding a single item (not wrapped in array)
This commit is contained in:
parent
1fc0a0191b
commit
8273b8654a
1 changed files with 5 additions and 2 deletions
|
@ -24,7 +24,10 @@ Ox.Clipboard = (function() {
|
||||||
if (type != clipboard.type) {
|
if (type != clipboard.type) {
|
||||||
Ox.Clipboard.clear();
|
Ox.Clipboard.clear();
|
||||||
}
|
}
|
||||||
clipboard = {items: clipboard.items.concat(items), type: type};
|
clipboard = {
|
||||||
|
items: clipboard.items.concat(Ox.makeArray(items)),
|
||||||
|
type: type
|
||||||
|
};
|
||||||
$element && $element.triggerEvent('add', clipboard);
|
$element && $element.triggerEvent('add', clipboard);
|
||||||
return clipboard.items.length;
|
return clipboard.items.length;
|
||||||
},
|
},
|
||||||
|
@ -40,7 +43,7 @@ Ox.Clipboard = (function() {
|
||||||
return clipboard.items.length;
|
return clipboard.items.length;
|
||||||
},
|
},
|
||||||
copy: function(items, type) {
|
copy: function(items, type) {
|
||||||
clipboard = {items: items, type: type};
|
clipboard = {items: Ox.makeArray(items), type: type};
|
||||||
$element && $element.triggerEvent('copy', clipboard);
|
$element && $element.triggerEvent('copy', clipboard);
|
||||||
return clipboard.items.length;
|
return clipboard.items.length;
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in a new issue