Sha256: 4f1de38d7f5b2625f484a7260f1b324a254f3f70d8b1d74c16a5b2257f456399
Contents?: true
Size: 1.9 KB
Versions: 32
Compression:
Stored size: 1.9 KB
Contents
<%= javascript_include_tag "jquery-1.6.2.min" %> <%= javascript_include_tag "jquery-ui-1.8.15.custom.min" %> <%= javascript_include_tag "jquery-ui-nestedSortable" %> <h3 class="fieldset name"><%= @fieldset.name %></h3> <p class="fieldset description"><%= @fieldset.description %></p> <script> $(function() { $( "#enable-sorting" ).toggle( function() { // Enable sorting $( "#children" ).sortable('enable'); $( "#children" ).addClass('sort'); $( "#children" ).find('.admin').css('visibility','hidden'); $("#enable-sorting").html('Save'); }, function() { // Disable sorting, save results $( "#children" ).sortable('disable'); $( "#children" ).removeClass('sort'); $( "#children" ).find('.admin').css('visibility','visible'); $("#enable-sorting").html('Change Ordering'); $.post( "children/reorder", $('#children').nestedSortable('serialize') ); }); $( "#children" ).nestedSortable({ forcePlaceholderSize: true, disableNesting: 'field', handle: 'div', helper: 'clone', items: 'li', opacity: .75, placeholder: 'placeholder', revert: 250, tabSize: 25, toleranceElement: 'div' }).sortable('disable'); }); </script> <button type="button" id="enable-sorting">Change Ordering</button> <div id="result"></div> <ol id="children"> <%= render :partial => 'child', :locals => { :fieldset => @fieldset } %> </ol> <%= render :partial => "associate_child", :locals => {:fieldset => @fieldset} %> <%= link_to 'Add Field', new_dynamic_fieldsets_field_path(:parent => @fieldset.id) %> | <%= link_to 'Add Fieldset', new_dynamic_fieldsets_fieldset_path(:parent => @fieldset.id) %> | <%= link_to 'Show Parent Fieldset', dynamic_fieldsets_fieldset_path(@fieldset) %> | <%= link_to 'Return to Manager', :controller => :fieldsets, :action => :roots %> <br />
Version data entries
32 entries across 32 versions & 1 rubygems