Last active
June 28, 2019 01:40
-
-
Save sijpkes/247c1bfb36910d52e2528b51ae28c420 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var findParentWithClass = function(node, _class) { | |
var parent = node.parentNode; | |
if(parent.className.indexOf(_class) !== -1) { | |
return parent; | |
} | |
return pfapp.findParentWithClass(parent, _class); | |
}; | |
var getFirstElementByNodeNameAfter = function(node, _nodeName) { | |
var sibling = node.nextSibling; | |
if(!sibling) return false; | |
if(sibling.nodeName === _nodeName.toUpperCase()) { | |
return sibling; | |
} | |
return pfapp.getFirstElementByNodeNameAfter(sibling, _nodeName) | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment