MCPcopy
hub / github.com/bendc/sprint / findAncestors

Function findAncestors

sprint.js:118–134  ·  view source on GitHub ↗
(startAtParent, limitToParent, limitToFirstMatch, selector, context)

Source from the content-addressed store, hash-verified

116 }
117
118 var findAncestors = function(startAtParent, limitToParent, limitToFirstMatch, selector, context) {
119 var dom = []
120 var self = this
121 this.each(function() {
122 var prt = startAtParent ? this.parentElement : this
123 while (prt) {
124 if (context && context == prt) break
125 if (!selector || self.is(selector, prt)) {
126 dom.push(prt)
127 if (limitToFirstMatch) break
128 }
129 if (limitToParent) break
130 prt = prt.parentElement
131 }
132 })
133 return Sprint(removeDuplicates(dom))
134 }
135
136 var getEventFromNamespace = function(event) {
137 return splitNamespaces(event)[0]

Callers

nothing calls this directly

Calls 1

removeDuplicatesFunction · 0.85

Tested by

no test coverage detected