diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index c8b55a695..791c6d806 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -59,7 +59,7 @@ module ApplicationHelper def show_and_goto_link(name, id, options={}) onclick = "Element.show('#{id}'); " onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ") - onclick << "location.href='##{id}-anchor'; " + onclick << "Element.scrollTo('#{id}'); " onclick << "return false;" link_to(name, "#", options.merge(:onclick => onclick)) end diff --git a/app/views/issues/_edit.rhtml b/app/views/issues/_edit.rhtml index 0f843e855..5bd685e47 100644 --- a/app/views/issues/_edit.rhtml +++ b/app/views/issues/_edit.rhtml @@ -32,7 +32,7 @@ :method => 'post', :update => 'preview', :with => 'Form.serialize("issue-form")', - :complete => "location.hash='preview'" + :complete => "Element.scrollTo('preview')" }, :accesskey => accesskey(:preview) %> <% end %> diff --git a/app/views/issues/new.rhtml b/app/views/issues/new.rhtml index 1e9e323fe..52c32dbbd 100644 --- a/app/views/issues/new.rhtml +++ b/app/views/issues/new.rhtml @@ -12,9 +12,8 @@ :method => 'post', :update => 'preview', :with => "Form.serialize('issue-form')", - :complete => "location.href='#preview-top'" + :complete => "Element.scrollTo('preview')" }, :accesskey => accesskey(:preview) %> <% end %> -
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml index 3392aef83..e3999bd8e 100644 --- a/app/views/issues/show.rhtml +++ b/app/views/issues/show.rhtml @@ -89,7 +89,6 @@ end %> <% end %> <% if authorize_for('issues', 'edit') %> -