From eee21cbe9031d37b3890dcb4c73296c22c86de9e Mon Sep 17 00:00:00 2001 From: Thomas Schulz Date: Sat, 5 Mar 2022 19:57:06 +0100 Subject: [PATCH] Fix "Maximum call stack size exceeded" error for too many items --- jquery.collection.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/jquery.collection.js b/jquery.collection.js index 29789fb..c118eaf 100644 --- a/jquery.collection.js +++ b/jquery.collection.js @@ -740,11 +740,9 @@ if (that.hasClass(settings.user_prefix + suffix)) { that.addClass(settings.prefix + suffix); } - that.find('*').each(function () { + that.find('.' + settings.user_prefix + suffix).each(function () { var here = $(this); - if (here.hasClass(settings.user_prefix + suffix)) { - here.addClass(settings.prefix + suffix); - } + here.addClass(settings.prefix + suffix); }); }); });