Update categories_order.html.erb

fix error
This commit is contained in:
chiu 2019-09-19 18:38:12 +08:00
parent 5f2382583b
commit 0fd6c634bf
1 changed files with 27 additions and 25 deletions

View File

@ -1,31 +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=[]
for (var ele in eles){
var temp = ele.split('=')
keys.push(temp[0])
values.push(temp[1])
}
if (navigator.onLine) {
$.ajax({
url : "/admin/archive_files/categories_order",
dataType : "json",
type : "post",
data:{data_keys: keys, data_values: 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;
$('form[name="category_sort_number_form"]').on('load',function(){
$('form[name="category_sort_number_form"]').submit(function(){
var eles = $('form[name="category_sort_number_form"]').serialize().split('&')
var keys=[],values=[]
for (var i=0;i<eles.length;i++){
var temp = eles[i].split('=')
keys.push(temp[0])
values.push(temp[1])
}
if (navigator.onLine) {
$.ajax({
url : "/admin/archive_files/categories_order",
dataType : "json",
type : "post",
data:{data_keys: keys, data_values: 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" >