Sha256: 574bae0e3f743d344ad08352766c6e835e57659b547d696814533d476febb3b1
Contents?: true
Size: 553 Bytes
Versions: 2
Compression:
Stored size: 553 Bytes
Contents
jQuery.fn.getPath = function () { if (this.length != 1) throw 'Requires one element.'; var path, node = this; while (node.length) { var realNode = node[0], name = realNode.localName; if (!name) break; name = name.toLowerCase(); var parent = node.parent(); var siblings = parent.children(name); if (siblings.length > 1) { name += ':eq(' + siblings.index(realNode) + ')'; } path = name + (path ? '>' + path : ''); node = parent; } return path; };
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
familiarity-0.2.5 | app/assets/javascripts/familiarity/jquery.getpath.js |
familiarity-0.2.4 | app/assets/javascripts/familiarity/jquery.getpath.js |