Matthias Mullie has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/172935

Change subject: Make $.findWithParent work with a set of comma-separated 
selectors
......................................................................

Make $.findWithParent work with a set of comma-separated selectors

Currently unused, but this would allow us to target multiple elements
with this method. It's similar to regular .find, which also supports
multiple selectors seperated by a comma.

Change-Id: I90958b8877501ef8487c42b2cad6de1d05e6dc86
---
M modules/engine/misc/jquery.findWithParent.js
1 file changed, 10 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Flow 
refs/changes/35/172935/1

diff --git a/modules/engine/misc/jquery.findWithParent.js 
b/modules/engine/misc/jquery.findWithParent.js
index a2a874e..995dbd0 100644
--- a/modules/engine/misc/jquery.findWithParent.js
+++ b/modules/engine/misc/jquery.findWithParent.js
@@ -32,6 +32,14 @@
 
        $.findWithParent = jQueryFindWithParent;
        $.fn.findWithParent = function ( selector ) {
-               return jQueryFindWithParent( this, selector );
+               var selectors = selector.split( ',' ),
+                       $elements = $(),
+                       self = this;
+
+               $.each( selectors, function( i, selector ) {
+                       $elements = $elements.add( jQueryFindWithParent( self, 
selector ) );
+               } );
+
+               return $elements;
        };
-}( jQuery ) );
\ No newline at end of file
+}( jQuery ) );

-- 
To view, visit https://gerrit.wikimedia.org/r/172935
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I90958b8877501ef8487c42b2cad6de1d05e6dc86
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Matthias Mullie <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to