From: Jean-Philippe Lang Date: Mon, 11 Feb 2008 20:45:46 +0000 (+0000) Subject: Replaced window.hash= by Element.scrollTo() X-Git-Tag: 0.7.0-RC1~150 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=93ef8b7f77ec84bef19d7a872a15b8d406cdb46e;p=redmine.git Replaced window.hash= by Element.scrollTo() git-svn-id: http://redmine.rubyforge.org/svn/trunk@1136 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- 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') %> -