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;