Skip to content

Commit

Permalink
Merge pull request #291 from alphagov/stop-auto-scroll
Browse files Browse the repository at this point in the history
Remove autofocus to prevent page scrolling
  • Loading branch information
alext committed Nov 14, 2014
2 parents aacb725 + 123f8bf commit 62c68e6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
3 changes: 0 additions & 3 deletions app/assets/javascripts/publications.js
@@ -1,9 +1,6 @@
// Javascript that may be used on every publication show/edit page

$(function () {
if (! 'autofocus' in document.createElement('input')) {
$('*[autofocus]').focus();
}

/*
Mark the edition form as dirty to prevent accidental navigation away from
Expand Down
4 changes: 2 additions & 2 deletions app/views/shared/_common_edition_attributes.html.erb
Expand Up @@ -5,7 +5,7 @@
</div>

<%= f.input :title,
:input_html => { :autofocus => true, :disabled => @resource.locked_for_edits?, class: 'input-md-7' } %>
:input_html => { :disabled => @resource.locked_for_edits?, class: 'input-md-7' } %>
<%= f.input :in_beta,
as: :boolean,
Expand All @@ -16,7 +16,7 @@
<%= f.input :alternative_title,
:label => 'Alternative title',
:hint => 'Use this where longer title is needed for SEO purposes',
:input_html => { :autofocus => true, :disabled => @resource.locked_for_edits?, class: 'input-md-7' } %>
:input_html => { :disabled => @resource.locked_for_edits?, class: 'input-md-7' } %>
<%= f.input :overview,
:as => :text,
Expand Down

0 comments on commit 62c68e6

Please sign in to comment.