From 43502c42a1e24b2beae5178b0c0bd3d3b89f795a Mon Sep 17 00:00:00 2001 From: rlx <0x0073@0x2620.org> Date: Fri, 2 Aug 2013 12:23:15 +0000 Subject: [PATCH] Ox.Clipboard: add public 'items' method (returns number of items) --- source/Ox.UI/js/Core/Clipboard.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/Ox.UI/js/Core/Clipboard.js b/source/Ox.UI/js/Core/Clipboard.js index f613e694..79296d1c 100644 --- a/source/Ox.UI/js/Core/Clipboard.js +++ b/source/Ox.UI/js/Core/Clipboard.js @@ -44,6 +44,9 @@ Ox.Clipboard = (function() { $element && $element.triggerEvent('copy', clipboard); return clipboard.items.length; }, + items: function(type) { + return !type || type == clipboard.type ? clipboard.items.length : 0; + }, paste: function(type) { return !type || type == clipboard.type ? clipboard.items : []; $element && $element.triggerEvent('paste', clipboard);