app/assets/javascripts/activeadmin-selleo-cms/custom.js in activeadmin-selleo-cms-0.0.18 vs app/assets/javascripts/activeadmin-selleo-cms/custom.js in activeadmin-selleo-cms-0.0.20

- old
+ new

@@ -25,10 +25,19 @@ }).error(function(){ alert('Could not delete attachment'); }); } +function update_positions(pagesArray) { + $('.update-positions-button').attr('disabled', true).attr('value', 'Saving...') + $.ajax({ + url: '/admin/pages/update_positions.js', + data: { 'page_ids': pagesArray }, + type: 'PUT' + }); +} + $(function(){ $('#translations.index input').blur(function(evt){ $.ajax({ url: $(evt.target).data('route') + '.js', type: 'PUT', @@ -49,7 +58,33 @@ data: _data }).success(function(){ $(that).closest('td').effect('highlight'); }); }); + + $(document).ready(function(){ + $('input.ui-datetimepicker').datetimepicker({ + dateFormat: 'yy-mm-dd', + timeFormat: 'HH:mm:ss' + }); + }); + + $('i.fold').click(function(){ + var form = $(this).closest('fieldset').find('ol'); + if (form.is(':visible')){ + $(this).text('Show'); + } else { + $(this).text('Hide'); + } + $(this).closest('fieldset').find('ol').toggle(); + }); + +// $('i.folded').click(); + + $('input[multiple]').each(function(){ + $(this).attr('name', $(this).attr('name').replace(/\[\]$/, '') ); + }); + + $( ".sortable" ).sortable(); + $( ".sortable" ).disableSelection(); }); \ No newline at end of file