Commit cd2542bd by tady Committed by tady

編集時にページ遷移を確認

parent 4eeaca33
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
<div class="col-md-2"> <div class="col-md-2">
<div class="actions"> <div class="actions">
<%= f.submit class: 'btn btn-primary' %> <%= f.submit class: 'btn btn-primary', id: 'save_button' %>
</div> </div>
</div> </div>
...@@ -71,6 +71,14 @@ ...@@ -71,6 +71,14 @@
$(function(){ $(function(){
'use strict'; 'use strict';
var confirmUnload = function() {
return '前のページに戻りますか?';
};
$(window).on('beforeunload', confirmUnload);
$('#save_button').on('click', function(){
$(window).off('beforeunload', confirmUnload);
});
// Automaticaly change textarea height. // Automaticaly change textarea height.
$('textarea.autosize').autosize(); $('textarea.autosize').autosize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment