forked from publify/publify
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace calendar_date_picker slutty plugin for Jquery datepicker. Not…
… as fun, but UJS
- Loading branch information
Thomas Lecavelier
committed
Oct 16, 2013
1 parent
c28cf66
commit 06fbd98
Showing
3 changed files
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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") %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters