From 5647f85a3cc88e8b650164d56839448abb5e0229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?John=20Molakvo=C3=A6=20=28skjnldsv=29?= Date: Thu, 16 Aug 2018 07:43:57 +0200 Subject: [PATCH] Object.values polyfill MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: John Molakvoæ (skjnldsv) --- apps/files/js/fileactions.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/apps/files/js/fileactions.js b/apps/files/js/fileactions.js index ac3afba038..8ce8eddb0b 100644 --- a/apps/files/js/fileactions.js +++ b/apps/files/js/fileactions.js @@ -558,6 +558,20 @@ } }); + function objectValues(obj) { + var res = []; + for (var i in obj) { + if (obj.hasOwnProperty(i)) { + res.push(obj[i]); + } + } + return res; + } + // polyfill + if (!Object.values) { + Object.values = objectValues; + } + var menuActions = Object.values(this.actions.all).filter(function (action) { return action.type !== OCA.Files.FileActions.TYPE_INLINE; });