mirror of
https://github.com/coderaiser/cloudcmd.git
synced 2026-01-23 10:45:47 +00:00
fix(listeners) header: event.path -> getPath (#101)
Replaced non-standard event.path which works in Chrome only
This commit is contained in:
parent
e909c929b1
commit
d3caa9dcd4
1 changed files with 12 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue