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: shortcut/shortcut.admin.js
Comments
Comment #1
nod_Comment #2
droplet commentedComment #3
nod_I'd prefer we don't add a new variable since replacing
selfwiththiswould work just as well.Comment #4
nod_Comment #5
nod_works for me
Comment #6
dries commentedCommitted to 8.x. Thanks.
Comment #7
David_Rothstein commentedI guess in general y'all aren't backporting these JSHint patches to Drupal 7 (which makes sense)... but this one seems like a straight-up bugfix, no?
Comment #8
droplet commentedI'd rather to hardcode it than using global (default) setting.
Comment #9
nod_That's not a bug actually just sloppy code.
selfwill resolve towindow.selfand both will be undefined. Meaning they will coerce to false in all the conditions tabledrag has on them. Basically it "just works"™ and we should hardcode it like droplet proposed, since this will not have any hierarchy ever.(In D8 all this code is gone now thanks to the remove shortcut limit patch)
Comment #10
oriol_e9gComment #11
droplet commentedComment #12
droplet commentedit's a bug fix and not the backports. D8 removed that part of code from other patches.
Comment #13
webchickSince it seems David already approves of this for 7.x, committed and pushed to 7.x. Thanks!