]> source.dussan.org Git - redmine.git/commitdiff
Replaced window.hash= by Element.scrollTo()
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 11 Feb 2008 20:45:46 +0000 (20:45 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Mon, 11 Feb 2008 20:45:46 +0000 (20:45 +0000)
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1136 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/helpers/application_helper.rb
app/views/issues/_edit.rhtml
app/views/issues/new.rhtml
app/views/issues/show.rhtml
app/views/wiki/edit.rhtml

index c8b55a6951769307aa9dc2b580222752e0a062ed..791c6d80628a6d352ef63e4b8a3c2179e752204e 100644 (file)
@@ -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
index 0f843e8552f9f36a2c3865746ec29ca43e9674c2..5bd685e47bb94e2b60665883cd5ed5dda79b042a 100644 (file)
@@ -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 %>
 
index 1e9e323fefbb69f782ef0b00f06585a2690ec6b6..52c32dbbdbca31ed5a966de2099328894c007caf 100644 (file)
@@ -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 %>
 
-<a name="preview-top"></a>
 <div id="preview" class="wiki"></div>
index 3392aef832778b87fa5e91748c29dfe275337e55..e3999bd8efd5ee382aceed2188b4f90a16066b07 100644 (file)
@@ -89,7 +89,6 @@ end %>
 <% end %>
 
 <% if authorize_for('issues', 'edit') %>
-  <a name="update-anchor"></a>
   <div id="update" style="display:none;">
   <h3><%= l(:button_update) %></h3>
   <%= render :partial => 'edit' %>
index 10276264fdc6c702ef3af783e5a9299877922f64..e5b0687f632f5986ca656e9f0bd47b7e06491c3f 100644 (file)
                          :method => 'post',
                          :update => 'preview',
                          :with => "Form.serialize('wiki_form')",
-                         :complete => "location.href='#preview-top'"
+                         :complete => "Element.scrollTo('preview')"
                        }, :accesskey => accesskey(:preview) %></p>
 <%= wikitoolbar_for 'content_text' %>
 <% end %>
 
-<a name="preview-top"></a>
 <div id="preview" class="wiki"></div>
 
 <% content_for :header_tags do %>