aboutsummaryrefslogtreecommitdiffstats
path: root/lib/jquery/src/manipulation/getAll.js
diff options
context:
space:
mode:
authorJesús Eduardo <heckyel@hyperbola.info>2017-08-06 20:43:24 -0500
committerJesús Eduardo <heckyel@hyperbola.info>2017-08-06 20:43:24 -0500
commitf7045b862a5b7c3de8ee2ea3da67616b38a667cc (patch)
tree504f420546df4934495bbd6f3d9761650b3783bd /lib/jquery/src/manipulation/getAll.js
downloadytlibre-f7045b862a5b7c3de8ee2ea3da67616b38a667cc.tar.lz
ytlibre-f7045b862a5b7c3de8ee2ea3da67616b38a667cc.tar.xz
ytlibre-f7045b862a5b7c3de8ee2ea3da67616b38a667cc.zip
first commit
Diffstat (limited to 'lib/jquery/src/manipulation/getAll.js')
-rw-r--r--lib/jquery/src/manipulation/getAll.js32
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/jquery/src/manipulation/getAll.js b/lib/jquery/src/manipulation/getAll.js
new file mode 100644
index 0000000..fede6c7
--- /dev/null
+++ b/lib/jquery/src/manipulation/getAll.js
@@ -0,0 +1,32 @@
+define( [
+ "../core",
+ "../core/nodeName"
+], function( jQuery, nodeName ) {
+
+"use strict";
+
+function getAll( context, tag ) {
+
+ // Support: IE <=9 - 11 only
+ // Use typeof to avoid zero-argument method invocation on host objects (#15151)
+ var ret;
+
+ if ( typeof context.getElementsByTagName !== "undefined" ) {
+ ret = context.getElementsByTagName( tag || "*" );
+
+ } else if ( typeof context.querySelectorAll !== "undefined" ) {
+ ret = context.querySelectorAll( tag || "*" );
+
+ } else {
+ ret = [];
+ }
+
+ if ( tag === undefined || tag && nodeName( context, tag ) ) {
+ return jQuery.merge( [ context ], ret );
+ }
+
+ return ret;
+}
+
+return getAll;
+} );