summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-29 19:50:07 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2008-06-29 19:50:07 +0000
commit47064c02f1445235c0fa3f69b25a3b29bcc2eca4 (patch)
treed590446e5b1ac084f4496dd654aa74c20323050e
parent5d6e9494ad49b3329da20bbd0e35bec8656886b4 (diff)
downloadredmine-47064c02f1445235c0fa3f69b25a3b29bcc2eca4.tar.gz
redmine-47064c02f1445235c0fa3f69b25a3b29bcc2eca4.zip
Makes issue update link work without javascript (#1337).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1605 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r--app/helpers/application_helper.rb2
-rw-r--r--app/views/issues/show.rhtml2
-rw-r--r--public/javascripts/application.js6
3 files changed, 8 insertions, 2 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 16904c251..4ba3445b7 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -51,7 +51,7 @@ module ApplicationHelper
link_to(name, "#", :onclick => onclick)
end
- def show_and_goto_link(name, id, options={})
+ def show_and_goto_js(id, options={})
onclick = "Element.show('#{id}'); "
onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
onclick << "Element.scrollTo('#{id}'); "
diff --git a/app/views/issues/show.rhtml b/app/views/issues/show.rhtml
index a3b26be12..b71a02ee7 100644
--- a/app/views/issues/show.rhtml
+++ b/app/views/issues/show.rhtml
@@ -1,5 +1,5 @@
<div class="contextual">
-<%= show_and_goto_link(l(:button_update), 'update', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) if authorize_for('issues', 'edit') %>
+<%= link_to_if_authorized(l(:button_update), {:controller => 'issues', :action => 'edit', :id => @issue }, :onclick => 'showAndScrollTo("update", "notes"); return false;', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %>
<%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
<%= watcher_tag(@issue, User.current) %>
<%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-copy' %>
diff --git a/public/javascripts/application.js b/public/javascripts/application.js
index 4e5b67e55..1674044f8 100644
--- a/public/javascripts/application.js
+++ b/public/javascripts/application.js
@@ -10,6 +10,12 @@ function checkAll (id, checked) {
}
}
+function showAndScrollTo(id, focus) {
+ Element.show(id);
+ if (focus!=null) { Form.Element.focus(focus); }
+ Element.scrollTo(id);
+}
+
var fileFieldCount = 1;
function addFileField() {