Ox.Clipboard: enforce uniqueness of items on add
This commit is contained in:
parent
e6541b2b32
commit
e3abfd2702
1 changed files with 4 additions and 1 deletions
|
@ -26,7 +26,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: Ox.unique(clipboard.items.concat(items)),
|
||||||
|
type: type
|
||||||
|
};
|
||||||
$element && $element.triggerEvent('add', clipboard);
|
$element && $element.triggerEvent('add', clipboard);
|
||||||
}
|
}
|
||||||
return clipboard.items.length;
|
return clipboard.items.length;
|
||||||
|
|
Loading…
Reference in a new issue