2015-04-16 07:11:04 +00:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
|
|
function getParents(element) {
|
|
|
|
|
|
|
|
var parents = [];
|
|
|
|
|
|
|
|
while (element) {
|
|
|
|
element = element.parent;
|
|
|
|
|
|
|
|
if (element) {
|
|
|
|
parents.push(element);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return parents;
|
|
|
|
}
|
|
|
|
|
2015-08-21 12:21:56 +00:00
|
|
|
module.exports.getParents = getParents;
|