fix ajax error when edit new page

This commit is contained in:
Fu Matthew 2013-01-24 13:39:08 +08:00
parent 979df9ac80
commit fea1726f6d
1 changed files with 3 additions and 7 deletions

View File

@ -37,7 +37,7 @@ module Admin::PagePartsHelper
def tag_checked_value(part,radio_value)
if radio_value.blank?
part[:tag].blank?? true : false
(part.nil? || part[:tag].blank?)? true : false
else
part and (part[:tag] == radio_value.to_s) ? true : false
end
@ -45,7 +45,7 @@ module Admin::PagePartsHelper
def category_checked_value(part,radio_value)
if radio_value.blank?
part[:category].blank?? true : false
(part.nil? || part[:category].blank?)? true : false
else
part and (part[:category] == radio_value.to_s) ? true : false
end
@ -84,11 +84,7 @@ module Admin::PagePartsHelper
end
def show_default_widget_setting_panel
if @module_app && @module_app.has_default_widget? && (!@user_choose.nil? && @user_choose== 'default_widget') #&& @part.widget_path == 'default_widget'
true
else
false
end
@module_app && @module_app.has_default_widget? && (!@user_choose.nil? && @user_choose== 'default_widget') #&& @part.widget_path == 'default_widget'
end
def show_custom_widget_setting_panel