diff options
author | Brian Evans <grknight@gentoo.org> | 2020-10-02 15:10:45 -0400 |
---|---|---|
committer | Brian Evans <grknight@gentoo.org> | 2020-10-02 15:10:45 -0400 |
commit | 66b99353c268916fa29984c2631c87fd619ba570 (patch) | |
tree | 63e52db67e004b9947bdd1791d3ecaec33d9f36f /Thanks/modules/jquery.findWithParent.js | |
parent | Update PluggableAuth to 1.35 (diff) | |
download | extensions-66b99353c268916fa29984c2631c87fd619ba570.tar.gz extensions-66b99353c268916fa29984c2631c87fd619ba570.tar.bz2 extensions-66b99353c268916fa29984c2631c87fd619ba570.zip |
Update Thanks to 1.35
Signed-off-by: Brian Evans <grknight@gentoo.org>
Diffstat (limited to 'Thanks/modules/jquery.findWithParent.js')
-rw-r--r-- | Thanks/modules/jquery.findWithParent.js | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Thanks/modules/jquery.findWithParent.js b/Thanks/modules/jquery.findWithParent.js index 79c09c71..c8ec6001 100644 --- a/Thanks/modules/jquery.findWithParent.js +++ b/Thanks/modules/jquery.findWithParent.js @@ -1,8 +1,8 @@ -( function ( $ ) { +( function () { /** @class jQuery */ /** - * Gives support to find parent elements using .closest with less-than selector syntax. + * Adds support to find parent elements using .closest with less-than selector syntax. * * $.findWithParent( $div, "< html div < body" ); // find closest parent of $div "html", find child "div" of it, find closest parent "body" of that, return "body" * $( '#foo' ).findWithParent( '.bar < .baz' ); // find child ".bar" of "#foo", return closest parent ".baz" from there @@ -16,16 +16,16 @@ var matches; $context = $( $context ); - selector = $.trim( selector ); + selector = selector.trim(); while ( selector && ( matches = selector.match( /(.*?(?:^|[>\s+~]))(<\s*[^>\s+~]+)(.*?)$/ ) ) ) { - if ( $.trim( matches[ 1 ] ) ) { + if ( matches[ 1 ].trim() ) { $context = $context.find( matches[ 1 ] ); } - if ( $.trim( matches[ 2 ] ) ) { + if ( matches[ 2 ].trim() ) { $context = $context.closest( matches[ 2 ].substr( 1 ) ); } - selector = $.trim( matches[ 3 ] ); + selector = matches[ 3 ].trim(); } if ( selector ) { @@ -41,17 +41,17 @@ /** * @param {string} selector * @return {jQuery} - * See {@link jQuery#findWithParent} + * @see jQuery#findWithParent */ $.fn.findWithParent = function ( selector ) { var selectors = selector.split( ',' ), $elements = $(), self = this; - $.each( selectors, function ( i, selector ) { + selectors.forEach( function ( selector ) { $elements = $elements.add( jQueryFindWithParent( self, selector ) ); } ); return $elements; }; -}( jQuery ) ); +}() ); |