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

nod_’s picture

core/modules/shortcut/shortcut.admin.js: line 55, col 75, 'self' is not defined.
core/modules/shortcut/shortcut.admin.js: line 55, col 95, 'self' is not defined.
droplet’s picture

Status: Active » Needs review
StatusFileSize
new653 bytes
nod_’s picture

Status: Needs review » Needs work

I'd prefer we don't add a new variable since replacing self with this would work just as well.

nod_’s picture

Status: Needs work » Needs review
StatusFileSize
new839 bytes
nod_’s picture

Status: Needs review » Reviewed & tested by the community

works for me

dries’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 8.x. Thanks.

David_Rothstein’s picture

Version: 8.x-dev » 7.x-dev
Status: Fixed » Patch (to be ported)

I 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?

droplet’s picture

I'd rather to hardcode it than using global (default) setting.

var changedRowObject = new tableDrag.row(changedRow, 'mouse', false, 0, true);
nod_’s picture

That's not a bug actually just sloppy code.

self will resolve to window.self and 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)

oriol_e9g’s picture

Status: Patch (to be ported) » Needs review
StatusFileSize
new794 bytes
droplet’s picture

Status: Needs review » Reviewed & tested by the community
droplet’s picture

Category: task » bug

it's a bug fix and not the backports. D8 removed that part of code from other patches.

webchick’s picture

Status: Reviewed & tested by the community » Fixed

Since it seems David already approves of this for 7.x, committed and pushed to 7.x. Thanks!

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