Skip to main content

Bug Tracker

Side navigation

#3594 closed enhancement (invalid)

Opened November 11, 2008 08:18PM UTC

Closed November 13, 2010 07:57PM UTC

Patch: removeClass eats RegExp

Reported by: woid Owned by:
Priority: minor Milestone: 1.2
Component: core Version: 1.2.6
Keywords: Cc:
Blocked by: Blocking:
Description

Motivation: It is sometimes handy to remove classes using regular expression. Also hasClass should understand them.

About the patch:

Its an oneliner in className.has method. So, it affects primary hasClass functionality. removeClass is enhanced by this change automatically. It affects also addClass, toggleClass and maybe other methods calling className.has. I see no point in using RegExp in those other cases, so I have not added guards to keep code clean.

patch against trunk r5939

Attachments (1)
Change History (2)

Changed November 11, 2008 08:26PM UTC by woid comment:1

Correction: I does not affect hasClass, that function is implemented using is function.

Changed November 13, 2010 07:57PM UTC by dmethvin comment:2

resolution: → invalid
status: newclosed

The code has changed since this patch was made, so it doesn't work as intended anymore. It would be possible to add the ability for hasClass to take a regexp but that wouldn't impact its use in removeClass.