Update categories_order.html.erb

fix error
This commit is contained in:
chiu 2019-09-18 22:22:46 +08:00
parent f15ccf466d
commit 69444380a8
1 changed files with 28 additions and 0 deletions

View File

@ -1,5 +1,33 @@
<% all_locales = I18n.available_locales %>
<% count = all_locales.length %>
<script>
$('form[name="category_sort_number_form"]').submit(function(){
var eles = $('form[name="category_sort_number_form"]').serialize().split('&')
var keys=[],values=[]
eles.each(function(){
var temp = this.split('=')
keys.push(temp[0])
values.push(temp[1])
})
if (navigator.onLine) {
$.ajax({
url : "/admin/archive_files/categories_order",
dataType : "json",
type : "post",
data:{form_sort_data:[keys,values]},
success:function(data){
location.reload();
},
error:function(){
alert('Your server has some problem, please try again later!')
}
})
} else {
alert('Please connect the network and try again later!')
}
return false;
})
</script>
<form method="post" action="/admin/archive_files/categories_order" name="category_sort_number_form" >
<table>
<thead style='line-height: 3;'>