Early Bird Registration for DrupalCon Portland 2024 is open! Register by 23:59 PST on 31 March 2024, to get $100 off your ticket.
Part of the JavaScript selectors clean-up effort.
#1574470: Selectors clean-up
#1415788: Javascript winter clean-up
Comment | File | Size | Author |
---|---|---|---|
#5 | core-1751430-5.patch | 2.84 KB | oxyc |
#2 | core-1751430-2.patch | 2.67 KB | oxyc |
Comments
Comment #1
nod_need $ prefix, please put table[0].tbodies[0] in a variable somewhere :)
Comment #2
oxyc CreditAttribution: oxyc commentedSomething like this?
Comment #3
oxyc CreditAttribution: oxyc commentedComment #4
nod_Those two things in a variable as well:
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 :)
Comment #5
oxyc CreditAttribution: oxyc commentedThanks 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?).
Comment #6
nod_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.
Comment #7
webchickCommitted and pushed to 8.x. Thanks!