From cb55fbb344174311215feef90a500ab768e082a9 Mon Sep 17 00:00:00 2001 From: Tom Byers Date: Tue, 2 Apr 2019 11:38:27 +0100 Subject: [PATCH] Fix reference to non-existent jQuery collection Raised on PR as comment: https://github.com/alphagov/notifications-admin/pull/2880/commits/e4b4be9d459b73196bb5c403cdec881f68462440#r270781103 --- app/assets/javascripts/autofocus.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/autofocus.js b/app/assets/javascripts/autofocus.js index 299914e4b..c280b7454 100644 --- a/app/assets/javascripts/autofocus.js +++ b/app/assets/javascripts/autofocus.js @@ -2,14 +2,14 @@ "use strict"; Modules.Autofocus = function() { - this.start = function($component) { - var forceFocus = $component.data('forceFocus'); + this.start = function(component) { + var forceFocus = $(component).data('forceFocus'); // if the page loads with a scroll position, we can't assume the item to focus onload // is still where users intend to start if (($(window).scrollTop() > 0) && !forceFocus) { return; } - $('input, textarea, select', $component).eq(0).trigger('focus'); + $('input, textarea, select', component).eq(0).trigger('focus'); }; };