Skip to content

Commit

Permalink
Replace calendar_date_picker slutty plugin for Jquery datepicker. Not…
Browse files Browse the repository at this point in the history
… as fun, but UJS
  • Loading branch information
Thomas Lecavelier committed Oct 16, 2013
1 parent c28cf66 commit 06fbd98
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/assets/javascripts/administration_jquery.js
@@ -1,4 +1,8 @@
$(document).ready(function(){
// Spinners
$('form.spinnable').on('ajax:before', function(evt, xhr, status){ $('#spinner').show();})
$('form.spinnable').on('ajax:after', function(evt, xhr, status){ $('#spinner').hide();})

// DatePickers
$('.datepicker').datepicker();
});
2 changes: 1 addition & 1 deletion app/views/admin/content/autosave.js.erb
@@ -1,5 +1,5 @@
$('#autosave').replaceWith('<%= hidden_field_tag('articles[id]', @article.id %>')
$('#preview_link').replaceWith('<%= url_for({:controller => '/articles', :action => 'preview', :id => @article.id}, {:target => 'new', :class => 'btn info'}) %>')
$('#destroy_link').replaceWith('<%= link_to_destroy_draft(@article) %>')
$('#publish').replaceWith('<%= calendar_date_select('article', 'published_at', {:class => 'span7'}) %>')
$('#publish').replaceWith('<%= text_field_tag('article', 'published_at', {:class => 'span7 datepicker'}) %>')
<%= gflash :success => _("Article was successfully saved") %>
2 changes: 1 addition & 1 deletion app/views/admin/notes/new.html.erb
Expand Up @@ -27,7 +27,7 @@
<%= _("Published") %>
</label>
<label for='note_published_at'><%= _("Publish at") %></label>
<%= calendar_date_select 'note', 'published_at', {:class => 'span11'} %>
<%= text_field 'note', 'published_at', {:class => 'span11 datepicker'} %>
</fieldset>
<div class='pull-right'>
<%= save( _("Publish")) %>
Expand Down

0 comments on commit 06fbd98

Please sign in to comment.