Part of the JavaScript selectors clean-up effort.
#1574470: Selectors clean-up
#1415788: Javascript winter clean-up

CommentFileSizeAuthor
#5 core-1751430-5.patch2.84 KBoxyc
#2 core-1751430-2.patch2.67 KBoxyc
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nod_’s picture

need $ prefix, please put table[0].tbodies[0] in a variable somewhere :)

oxyc’s picture

FileSize
2.67 KB

Something like this?

oxyc’s picture

Status: Active » Needs review
nod_’s picture

Status: Needs review » Needs work

Those two things in a variable as well:

settings.taxonomy.backStep
settings.taxonomy.forwardStep

And it looks like we can move the 3 calls like that $table.find('tr.taxonomy-term-divider-bottom') out of the .onSwap function.

With that we should be good to go :)

oxyc’s picture

Status: Needs work » Needs review
FileSize
2.84 KB

Thanks for the review,

However, as I read this code, moving out the selectors would have side affects as the classes gets manipulated on the rows depending on how they swap, therefore it should be re-selected on each swap.

One more note, it seems it doesn't acutally matter, the behavior function itself is executed on each swap (tabledrag.js bug?).

nod_’s picture

Status: Needs review » Reviewed & tested by the community

oh yeah you're right about the classes read too quickly :)

tabledrag is kinda messy. As long as it works, that's fine I'm not too worried about how it works when it comes to tabledrag.

Works great, thanks.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.