Fix homepage in structure, ajaxStop for structure edit, setForm in pageslide.js

This commit is contained in:
chris 2013-10-21 11:13:15 +08:00
parent 52fa11a429
commit 94c1d7d5a0
4 changed files with 16 additions and 17 deletions

View File

@ -327,15 +327,7 @@
function setForm(data) { function setForm(data) {
$.each(data, function(key, value) { $.each(data, function(key, value) {
switch($("#pageslide form #" + key).prop("tagName")) $("#pageslide form #" + key).val(value);
{
case "INPUT":
$("#pageslide form #" + key).val(value);
break;
case "SELECT":
$("#pageslide form #" + key).val(value);
break;
}
}); });
} }

View File

@ -9,7 +9,15 @@ class PagesController < ApplicationController
if @item if @item
delayed_impressionist(@item) delayed_impressionist(@item)
render_page if params[:edit]
if request.referer && request.referer.ends_with?("admin/items")
redirect_to admin_page_url(@item)
else
render :file => "#{Rails.root}/public/403.html", :status => 403
end
else
render_page
end
else else
redirect_to '/admin/dashboards',:notice=>t(:need_home) redirect_to '/admin/dashboards',:notice=>t(:need_home)
# render :text => t(:need_home) # render :text => t(:need_home)

View File

@ -29,13 +29,11 @@
<% end -%> <% end -%>
<% if @edit %> <% if @edit %>
<script> <script>
$(window).load(function() { $(document).ajaxStop(function() {
setTimeout(function(){ $('a').not('.nav').on('click', function(e){
$('a').not('.nav').on('click', function(e){ e.preventDefault();
e.preventDefault(); });
}); $('a').not('.nav').css("cursor", "default");
$('a').not('.nav').css("cursor", "default");
}, 200);
}); });
</script> </script>
<style> <style>

View File

@ -25,6 +25,7 @@ namespace :new_ui do
migrate_managers migrate_managers
migrate_ad_images_dates migrate_ad_images_dates
migrate_ad_banners migrate_ad_banners
save_pages
end end
# :category_name is optional, depends on the naming of the category model: if no conventional, specify it # :category_name is optional, depends on the naming of the category model: if no conventional, specify it