1313 * var element = domElement.findOne(".form");
1414 * var element = domElement.findOne("#form");
1515 */
16- angular . element . prototype . findOne = function ( selector ) {
17- return angular . element ( this [ 0 ] . querySelector ( selector ) ) ;
16+ angular . element . prototype . findOne = function ( selector ) {
17+ return angular . element ( this [ 0 ] . querySelector ( selector ) ) ;
1818} ;
1919
2020/**
@@ -29,8 +29,8 @@ angular.element.prototype.findOne = function(selector) {
2929 * var elementList = domElement.findAll(".form");
3030 * var elementList = domElement.findAll("#form");
3131 */
32- angular . element . prototype . findAll = function ( selector ) {
33- return angular . element ( this [ 0 ] . querySelectorAll ( selector ) ) ;
32+ angular . element . prototype . findAll = function ( selector ) {
33+ return angular . element ( this [ 0 ] . querySelectorAll ( selector ) ) ;
3434} ;
3535
3636/**
@@ -45,36 +45,36 @@ angular.element.prototype.findAll = function(selector) {
4545 * var parents = domElement.parents(".form");
4646 * var parents = domElement.parents("#form");
4747 */
48- angular . element . prototype . parents = function ( selector ) {
49- // At least IE6
50- var isIE = /*@cc_on !@*/ false || ! ! document . documentMode ;
48+ angular . element . prototype . parents = function ( selector ) {
49+ // At least IE6
50+ var isIE = /*@cc_on !@*/ false || ! ! document . documentMode ;
5151
52- var element = this [ 0 ] ;
53- var parents = [ ] ;
52+ var element = this [ 0 ] ;
53+ var parents = [ ] ;
5454
55- // Traverse element's ancestor tree until the upto the root and pushing all the ancestors to an array.
56- while ( element . parentNode . parentNode ) {
57- element = element . parentNode ;
55+ // Traverse element's ancestor tree until the upto the root and pushing all the ancestors to an array.
56+ while ( element . parentNode . parentNode ) {
57+ element = element . parentNode ;
5858
59- // Get the ancestors of element filtered by a selector (if any)
60- if ( selector ) {
61- if ( isIE ) {
62- /*
63- * For IE versions less then 9. Since Microsoft introduces msMatchesSelector method from 9.
64- * @see Browser compatibility in https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
65- */
66- if ( element . msMatchesSelector ( selector ) ) {
67- parents . push ( element ) ;
68- }
69- } else {
70- if ( element . matches ( selector ) ) {
71- parents . push ( element ) ;
72- }
73- }
74- } else {
75- // If no selector is defined then get all the ancestors with no filtering
76- parents . push ( element ) ;
59+ // Get the ancestors of element filtered by a selector (if any)
60+ if ( selector ) {
61+ if ( isIE ) {
62+ /*
63+ * For IE versions less then 9. Since Microsoft introduces msMatchesSelector method from 9.
64+ * @see Browser compatibility in https://developer.mozilla.org/en-US/docs/Web/API/Element/matches
65+ */
66+ if ( element . msMatchesSelector ( selector ) ) {
67+ parents . push ( element ) ;
7768 }
69+ } else {
70+ if ( element . matches ( selector ) ) {
71+ parents . push ( element ) ;
72+ }
73+ }
74+ } else {
75+ // If no selector is defined then get all the ancestors with no filtering
76+ parents . push ( element ) ;
7877 }
79- return angular . element ( parents ) ;
78+ }
79+ return angular . element ( parents ) ;
8080} ;
0 commit comments