some fix for chrome

This commit is contained in:
Harry Bomrah 2014-12-30 21:48:02 +08:00
parent dbc9e5a931
commit ac4f8374cc
2 changed files with 5 additions and 16 deletions

View File

@ -33,6 +33,10 @@ class Admin::RegisteredSitesController < OrbitAdminController
end
def change_access_status
if !request.xhr?
redirect_to admin_registered_sites_path(:page => params[:page])
return
end
status = params[:status]
site = RegisteredSite.find_by(:uid => params[:uid])
case status

View File

@ -1,16 +1 @@
$("#index_table").html("<%= j render 'index' %>");
var atags = $(".pagination a");
if (atags.length > 0){
atags.each(function(){
var el = $(this);
if(el.attr("href")){
var url = "http://" + window.location.host + el.attr("href");
uri = new URL(url);
if(uri.searchParams.get("page")){
$(this).attr("href","/<%= locale.to_s %>/admin/registered_sites?page=" + uri.searchParams.get("page"));
}else{
$(this).attr("href","/<%= locale.to_s %>/admin/registered_sites");
}
}
})
}
$("#index_table").html("<%= j render 'index' %>");