Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#6345 closed enhancement (invalid)

Allow .data() to accept a function for its setter argument

Reported by: kswedberg Owned by: kswedberg
Priority: undecided Milestone: 1.5
Component: data Version: 1.5
Keywords: Cc:
Blocked by: Blocking:

Description

This would be nice, as it aligns .data() with .css(), .attr(), and all the domManip methods that take a function setter.

I've committed a patch to my fork on Github, along with tests:

http://github.com/kswedberg/jquery/commit/1b5f3836fd63522bdf0ec41d21aa859db05904f0

Change History (6)

comment:1 Changed 7 years ago by dmethvin

#5896 is a duplicate of this ticket.

comment:2 Changed 7 years ago by SlexAxton

Milestone: 1.4.31.4.5
Owner: set to kswedberg
Priority: undecided
Status: newpending

That patch seems to be gone, karl, any chance we can see it again?

comment:3 Changed 7 years ago by kswedberg

Status: pendingassigned

Hey Alex, Sorry about that. I think I annihilated the fork/branch that had that commit. I'll try to get something committed again.

comment:4 Changed 7 years ago by kswedberg

Resolution: invalid
Status: assignedclosed

ajpiano pointed out that .data() should be able to store functions just as it stores any other type. so treating functions differently ( by calling them ) wouldn't be a good idea. Closing this ticket. :'(

comment:5 Changed 7 years ago by john

Version: 1.4.21.5

There wasn't a 1.4.5 release, was actually 1.5.

comment:6 Changed 7 years ago by john

Milestone: 1.4.51.5

There was no 1.4.5 release, was actually 1.5.

Note: See TracTickets for help on using tickets.