Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Follow-up of #1664940: [Policy, patch] Decide on JSHint configuration and part of #1415788: Javascript winter clean-up
Run jshint on the files with the configuration from the parent issue or use jshint.com with the following options:
/*jshint forin:true, noarg:true, eqeqeq:true, undef:true, curly:true, browser:true, expr:true, latedef:true, newcap:true, trailing:true */
/*global Drupal, jQuery */
Fix any warnings or errors the tool finds.
Check manually that the fixes did not break any functionalities
Create patch and upload for the testbot.
Files: tabledrag.js
Comment | File | Size | Author |
---|---|---|---|
#17 | core-jshint-tabledrag-1684812-17.patch | 728 bytes | nod_ |
#8 | core-js-jshint-tabledrag-1684812-8.patch | 16.73 KB | nod_ |
#7 | 1684812-jshint-tabledrag-7.patch | 17.3 KB | seutje |
#4 | tabledrag-jshint.patch | 15.99 KB | droplet |
Comments
Comment #1
nod_See #1524414: Rewrite tabledrag.js to use jQuery UI as a proper way of addressing the architecture issues on top of cleaning up.
Comment #2
nod_hold off until rewrite
Comment #3
nod_Actually no, that's not a bad thing to do in the meantime. there are a lot of things to fix but they should be pretty easy.
Comment #4
droplet CreditAttribution: droplet commentedPlease test it carefully, thanks :)
Comment #5
droplet CreditAttribution: droplet commentedComment #6
seutje CreditAttribution: seutje commentedFirefox breaks on
TypeError: $indentation.get(1) is undefined
line 94Chrome on
Uncaught TypeError: Cannot read property 'offsetLeft' of undefined
line 94investigating...
Comment #7
seutje CreditAttribution: seutje commentedI fixed a few scoping issues created by abstracting anonymous, but for some reason
self.table
ends up being a jQuery collection instead of a reference to an HTML element which screws up the call to tBodies on line 652, but I can't figure out why (or where) it's being turned into a jQuery collection.After staring at it for almost 2 hours now, I'm gonna let it rest for a while. Feel free to pick this up further, if nobody does, I'll look into this again in a day or so, cause right now, I'm blind-staring and I have to head home in a minute.
Comment #8
nod_umm don't add the tabledragHandle to the behavior object I'd like to avoid having anything beside attach/detach in there.
Check what you send to Drupal.tableDrag in attachBehaviors should not be a jQuery object :D
Comment #9
seutje CreditAttribution: seutje commentedoh god, of course... sleep-deprivation--
will review after some shut-eye
Comment #10
seutje CreditAttribution: seutje commentedManually tested on chrome, ff and a (real) IE8, functionality works as expected.
Good to go, if you ask me!
Comment #11
droplet CreditAttribution: droplet commentedIt can be oneline.
Comment #12
nod_yeah but that's not necessary to fix the jshint errors. We can do that in the rewrite issue.
Comment #13
nod_#8: core-js-jshint-tabledrag-1684812-8.patch queued for re-testing.
Comment #14
catchThanks for the manual testing . Committed/pushed to 8.x.
Comment #16
nod_New JSHint config #1995996: Update JSHint configuration.
Comment #17
nod_Comment #18
droplet CreditAttribution: droplet commentedTested, no errors.
Comment #19
alexpottCommitted e52b50f and pushed to 8.x. Thanks!