#6457 closed enhancement (invalid)
Add a param to end() so that it can end multiple levels at once
Reported by: | Seldaek | Owned by: | |
---|---|---|---|
Priority: | undecided | Milestone: | |
Component: | core | Version: | 1.4.2 |
Keywords: | needsreview end | Cc: | |
Blocked by: | Blocking: |
Description
I would like to have the possibility when nesting heavily selectors to jump out of many at a time, using .end(3) for example, would be the equivalent of .end().end().end().
Granted, I don't need it too often, but I thought this was typically the kind of feature jQuery should have, so I made a patch.
You can view the patch, and pull it straight if interested, on github: http://github.com/Seldaek/jquery/commit/7bb02a9be24c9ca5b6be150f92b2c09bd4837d0b
Change History (6)
comment:1 Changed 12 years ago by
Milestone: | 1.4.3 |
---|
comment:2 Changed 12 years ago by
Keywords: | needsreview added |
---|---|
Priority: | → undecided |
This seems like a bad idea to me, the multiple .end() statements syntactically correspond to the filtering method that they end.
comment:3 Changed 12 years ago by
I have never loved .end() -- this seems like it would encourage even more difficult-to-decipher and difficult-to-maintain code. If this functionality is really desired, I'd say just do it as a plugin that overrides .end() or defines some other method that accepts an argument.
comment:4 Changed 12 years ago by
Resolution: | → invalid |
---|---|
Status: | new → closed |
I would like to add a final +1 to this being a bad idea. In addition to this likely not being something an extensive number of people in the community would use, rmurphey's comment regarding it's probable encouragement of difficult to interpret code is very much something I agree with here.
Resetting milestone to future.