mirror of
https://github.com/TracksApp/tracks.git
synced 2026-01-30 20:55:17 +01:00
[Contributed by Luke]. Applied Luke's patch to enable newly created contexts and projects to be dragged and dropped. Fixes #136.
git-svn-id: http://www.rousette.org.uk/svn/tracks-repos/trunk@154 a4c988fc-2ded-0310-b66e-134b36920a42
This commit is contained in:
parent
1e5425ffdc
commit
69773d159d
2 changed files with 16 additions and 16 deletions
|
|
@ -5,13 +5,13 @@
|
|||
<%= render_partial( 'context_listing', context ) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= sortable_element 'list-contexts',
|
||||
:tag => 'div',
|
||||
:handle => 'handle',
|
||||
:complete => visual_effect(:highlight, 'list-contexts'),
|
||||
:url => {:controller => 'context', :action => 'order'}
|
||||
%>
|
||||
<% sortable_options = {
|
||||
:tag => 'div',
|
||||
:handle => 'handle',
|
||||
:complete => visual_effect(:highlight, 'list-contexts'),
|
||||
:url => {:controller => 'context', :action => 'order'}
|
||||
}%>
|
||||
<%= sortable_element 'list-contexts', sortable_options %>
|
||||
<br />
|
||||
<a href="javascript:void(0)" onClick="Element.toggle('context_new'); Form.focusFirstElement('context-form');" accesskey="n" title="Create a new context">Create new context »</a>
|
||||
<div id="context_new" class="context_new" style="display:none">
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
:update=> "list-contexts",
|
||||
:position=> "bottom",
|
||||
:loading => "Form.reset('context-form')",
|
||||
:complete => "Form.focusFirstElement('context-form');",
|
||||
:complete => "Sortable.create('list-contexts', #{options_for_javascript(sortable_options)});Form.focusFirstElement('context-form');",
|
||||
:html=> { :id=>'context-form', :name=>'context', :class => 'inline-form' } %>
|
||||
<%= hidden_field( "context", "id" ) %>
|
||||
<label for="context_name">Context name</label>
|
||||
|
|
|
|||
|
|
@ -5,13 +5,13 @@
|
|||
<%= render_partial( 'project_listing', project ) %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= sortable_element 'list-projects',
|
||||
:tag => 'div',
|
||||
:handle => 'handle',
|
||||
:complete => visual_effect(:highlight, 'list-projects'),
|
||||
:url => {:controller => 'project', :action => 'order'}
|
||||
%>
|
||||
<% sortable_options = {
|
||||
:tag => 'div',
|
||||
:handle => 'handle',
|
||||
:complete => visual_effect(:highlight, 'list-contexts'),
|
||||
:url => {:controller => 'context', :action => 'order'}
|
||||
}%>
|
||||
<%= sortable_element 'list-projects', sortable_options %>
|
||||
<br />
|
||||
<a href="javascript:void(0)" onClick="Element.toggle('project_new'); Form.focusFirstElement('project-form');" accesskey="n" title="Create a new project">Create new project »</a>
|
||||
<div id="project_new" class="project_new" style="display:none">
|
||||
|
|
@ -20,7 +20,7 @@
|
|||
:update=> "list-projects",
|
||||
:position=> "bottom",
|
||||
:loading => "Form.reset('project-form')",
|
||||
:complete => "Form.focusFirstElement('project-form');",
|
||||
:complete => "Sortable.create('list-projects', #{options_for_javascript(sortable_options)});;Form.focusFirstElement('project-form');",
|
||||
:html=> { :id=>'project-form', :name=>'project', :class => 'inline-form' } %>
|
||||
<label for="project_name">Name:</label><br />
|
||||
<%= text_field 'project', 'name' %><br />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue