Ox.Clipboard: add public 'items' method (returns number of items)

This commit is contained in:
rlx 2013-08-02 12:23:15 +00:00
parent 2435dd2804
commit 43502c42a1

View file

@ -44,6 +44,9 @@ Ox.Clipboard = (function() {
$element && $element.triggerEvent('copy', clipboard); $element && $element.triggerEvent('copy', clipboard);
return clipboard.items.length; return clipboard.items.length;
}, },
items: function(type) {
return !type || type == clipboard.type ? clipboard.items.length : 0;
},
paste: function(type) { paste: function(type) {
return !type || type == clipboard.type ? clipboard.items : []; return !type || type == clipboard.type ? clipboard.items : [];
$element && $element.triggerEvent('paste', clipboard); $element && $element.triggerEvent('paste', clipboard);