From d3caa9dcd4b9300f73a3c5b1688ebf0e1930ade3 Mon Sep 17 00:00:00 2001 From: coderaiser Date: Fri, 27 Jan 2017 10:41:56 +0200 Subject: [PATCH] fix(listeners) header: event.path -> getPath (#101) Replaced non-standard event.path which works in Chrome only --- client/listeners.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/client/listeners.js b/client/listeners.js index 34831646..12300687 100644 --- a/client/listeners.js +++ b/client/listeners.js @@ -59,7 +59,7 @@ var Util, DOM, CloudFunc, CloudCmd; if (!/^(name|size|date)$/.test(name)) return; - var panel = event.path + var panel = getPath(el) .filter(isDataset) .filter(isPanel) .pop(); @@ -87,6 +87,17 @@ var Util, DOM, CloudFunc, CloudCmd; }); } + function getPath(el, path) { + path = path || []; + + if (!el) + return path; + + var parent = el.parentElement; + + return getPath(parent, path.concat(el)); + } + function config() { DOM.Files.get('config', function(e, config) { var type = config && config.packer;