##// END OF EJS Templates
Makes issue update link work without javascript (#1337)....
Jean-Philippe Lang -
r1591:47064c02f144
parent child
Show More
@@ -51,7 +51,7 module ApplicationHelper
51 link_to(name, "#", :onclick => onclick)
51 link_to(name, "#", :onclick => onclick)
52 end
52 end
53
53
54 def show_and_goto_link(name, id, options={})
54 def show_and_goto_js(id, options={})
55 onclick = "Element.show('#{id}'); "
55 onclick = "Element.show('#{id}'); "
56 onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
56 onclick << (options[:focus] ? "Form.Element.focus('#{options[:focus]}'); " : "this.blur(); ")
57 onclick << "Element.scrollTo('#{id}'); "
57 onclick << "Element.scrollTo('#{id}'); "
@@ -1,5 +1,5
1 <div class="contextual">
1 <div class="contextual">
2 <%= show_and_goto_link(l(:button_update), 'update', :class => 'icon icon-edit', :accesskey => accesskey(:edit)) if authorize_for('issues', 'edit') %>
2 <%= 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)) %>
3 <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
3 <%= link_to_if_authorized l(:button_log_time), {:controller => 'timelog', :action => 'edit', :issue_id => @issue}, :class => 'icon icon-time' %>
4 <%= watcher_tag(@issue, User.current) %>
4 <%= watcher_tag(@issue, User.current) %>
5 <%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-copy' %>
5 <%= link_to_if_authorized l(:button_copy), {:controller => 'issues', :action => 'new', :project_id => @project, :copy_from => @issue }, :class => 'icon icon-copy' %>
@@ -10,6 +10,12 function checkAll (id, checked) {
10 }
10 }
11 }
11 }
12
12
13 function showAndScrollTo(id, focus) {
14 Element.show(id);
15 if (focus!=null) { Form.Element.focus(focus); }
16 Element.scrollTo(id);
17 }
18
13 var fileFieldCount = 1;
19 var fileFieldCount = 1;
14
20
15 function addFileField() {
21 function addFileField() {
General Comments 0
You need to be logged in to leave comments. Login now