start work on revert

This commit is contained in:
John Bintz 2012-11-05 07:48:30 -05:00
parent ec81b268c1
commit a604a76e02
2 changed files with 22 additions and 1 deletions

View File

View File

@ -28,6 +28,27 @@ module ActionView
end end
alias_method_chain :form_for, :sisyphus alias_method_chain :form_for, :sisyphus
def sisyphus_status
buf = ActiveSupport::SafeBuffer.new
buf.safe_concat <<-JS
<div class="sisyphus_status" style="display:none">#{t('sisyphus.autosaved_content')}</div>
<script type="text/javascript">
(function() {
var original = $.sisyphus().options.onRestore;
$.sisyphus().options.onRestore = function() {
original();
$('.sisyphus_status').show();
};
})(this);
</script>
JS
buf
end
end end
end end
end end