Side navigation
#7378 closed feature (duplicate)
Opened November 02, 2010 01:48PM UTC
Closed December 30, 2010 04:18AM UTC
Last modified March 10, 2012 05:52AM UTC
New method: $.fn.classlist()
Reported by: | rwaldron | Owned by: | rwaldron |
---|---|---|---|
Priority: | undecided | Milestone: | 1.5 |
Component: | attributes | Version: | |
Keywords: | manipulation | Cc: | |
Blocked by: | Blocking: |
Description
Essentially, a jQuery method that wraps the brains of classList where available and provides a fallback where it isn't available. I'll provide more details via jsfiddle's when I get a chance.
Attachments (0)
Change History (9)
Changed November 02, 2010 01:49PM UTC by comment:1
component: | unfiled → attributes |
---|---|
keywords: | → manipulation |
owner: | → rwaldron |
status: | new → assigned |
Changed November 02, 2010 01:54PM UTC by comment:2
description: | Essentially, a jQuery method that wraps the brains of classList where available and provides a fallback where it doesn't. I'll provide more details via jsfiddle's when I get a chance. → Essentially, a jQuery method that wraps the brains of classList where available and provides a fallback where it isn't available. I'll provide more details via jsfiddle's when I get a chance. |
---|
Changed November 02, 2010 05:28PM UTC by comment:3
Changed November 02, 2010 05:41PM UTC by comment:4
_comment0: | yes, thats what I'm thinking. Thanks for posting the resource info \ \ Additionally, I put together these minimal requirements: \ \ Should: feature detect (adds a test for classList to jQuery.support), normalize functionality for both native and non-native, support classList functionality \ \ \ I spent the morning writing a draft of this and will have a repo available soon. Its very tight so far and offers: item(), add(), remove(), contains() and toggle() - using jQuery's own methods → 1288720425658262 |
---|
yes, thats what I'm thinking. Thanks for posting the resource info
Additionally, I put together these minimal requirements:
Should: feature detect (adds a test for classList to jQuery.support), normalize functionality for both native and non-native, support classList functionality
I spent the morning writing a draft of this and will have a repo available soon. Its very tight so far and offers: item(), add(), remove(), contains() and toggle() - using jQuery's own methods
Additionally, I have 59 unit tests written. Will start writing an api doc asap so it can be use tested.
Changed November 02, 2010 05:42PM UTC by comment:5
summary: | New method: $.fn.classes() → New method: $.fn.classlist() |
---|
Changed December 20, 2010 12:46AM UTC by comment:6
Since addClass/removeClass etc is the abstraction jQuery provides for classes, why wouldn't those methods just use elem.classList if available for the added perf?
Changing the API for class manipulation as a sort of polyfill seems like its not really jquery's style.
Changed December 20, 2010 12:50AM UTC by comment:7
I should've updated this ticket some time ago. Yes - thats the direction I've taken - no new api, but perf boosts where possible.
Changed December 30, 2010 04:18AM UTC by comment:8
resolution: | → duplicate |
---|---|
status: | assigned → closed |