Merge commit '0a7c43bbb96e7f91bd6ecb76f60733093473feaa' into development

This commit is contained in:
Matt K. Fu 2013-04-08 10:53:10 +08:00
commit e3666acdeb
7 changed files with 45 additions and 48 deletions

View File

@ -0,0 +1,38 @@
function append_id(){
if ($("#object_id").length == 1) {
return "&id="+$("#object_id").val();
}
else{
return '';
};
}
$("div.editable").live("mouseenter mouseleave", function (event) {
$(this).children('.edit_link').toggle();
});
$("#page_design").live('change', function() {
$.getScript($(this).attr('rel') + '?design_id=' + $(this).val() + append_id());
});
$("#module_app_list select").live('change', function() {
$.getScript($(this).attr('rel') + '?module_app_id='+$(this).val() + append_id());
});
$("#widget_list select,#frontend_list select").live('change', function() {
$.getScript($(this).attr('rel') +'?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() + append_id() );
});
$("#tag_list select").live('change', function() {
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + append_id() );
});
$("select.widget_field_select").live('change', function() {
$.getScript($(this).attr('rel') + '?widget_field_value='+ $(this).val()+'&dom_id=' + $(this).attr("id") + '&field_seri=' +$(this).attr('field_seri')+ '&module_app_id=' +$("#page_module_app_id,page_part_module_app_id").val() + append_id() );
});
$('.part_kind').live('click', function() {
$('.part_kind_partial').hide();
$('#part_' + $(this).attr('value')).show();
});

View File

@ -1,42 +1,3 @@
function append_id(){
if ($("#object_id").length == 1) {
return "&id="+$("#object_id").val();
}
else{
return '';
};
}
$("div.editable").live("mouseenter mouseleave", function (event) {
$(this).children('.edit_link').toggle();
});
$("#page_design").live('change', function() {
$.getScript($(this).attr('rel') + '?design_id=' + $(this).val() + append_id());
});
$("#module_app_list select").live('change', function() {
$.getScript($(this).attr('rel') + '?module_app_id='+$(this).val() + append_id());
});
$("#widget_list select,#frontend_list select").live('change', function() {
$.getScript($(this).attr('rel') +'?frontend=' + $(this).val() + '&module_app_id=' + $("#module_app_list select").val() + append_id() );
});
$("#tag_list select").live('change', function() {
$.getScript($(this).attr('rel') + '?type=' + $(this).val() + append_id() );
});
$("select.widget_field_select").live('change', function() {
$.getScript($(this).attr('rel') + '?widget_field_value='+ $(this).val()+'&dom_id=' + $(this).attr("id") + '&field_seri=' +$(this).attr('field_seri')+ '&module_app_id=' +$("#page_module_app_id,page_part_module_app_id").val() + append_id() );
});
$('.part_kind').live('click', function() {
$('.part_kind_partial').hide();
$('#part_' + $(this).attr('value')).show();
});
$(document).ready(function(){ $(document).ready(function(){
bindTreeDragHandle(); bindTreeDragHandle();
}); });

View File

@ -6,7 +6,7 @@ module DefaultWidgetHelper
def link_to_field(row_data,field, switch, options=nil) def link_to_field(row_data,field, switch, options=nil)
method_ary = @page_part.module_app.widget_fields_link_method method_ary = @page_part.module_app.widget_fields_link_method
field = field.to_sym field = field.to_sym
if(method_ary.has_key?(field) and (switch == true)) if(method_ary.has_key?(field) and (switch.to_s == "true"))
url = case method_ary[field][:args] url = case method_ary[field][:args]
when nil # no args when nil # no args
get_data_link(method_ary[field][:method], options) get_data_link(method_ary[field][:method], options)

View File

@ -19,5 +19,6 @@
</div> </div>
<% end %> <% end %>
<%=javascript_include_tag "inc/update_cates_and_tags.js" %> <%=javascript_include_tag "inc/update_cates_and_tags.js" %>
<%= javascript_include_tag "inc/page_widget_edit_interface.js" %>

View File

@ -2,8 +2,4 @@
<%= render 'admin/items/site_map_left_bar' %> <%= render 'admin/items/site_map_left_bar' %>
<% end -%> <% end -%>
<%= render 'edit' %> <%= render 'edit' %>

View File

@ -112,4 +112,5 @@
</div> </div>
</div> </div>
<%=javascript_include_tag "inc/update_cates_and_tags.js" %> <%=javascript_include_tag "inc/update_cates_and_tags.js" %>
<%= javascript_include_tag "inc/page_widget_edit_interface.js" %>

View File

@ -3,4 +3,4 @@
<%= render 'admin/items/site_map_left_bar' %> <%= render 'admin/items/site_map_left_bar' %>
<% end -%> <% end -%>
<%= render 'edit' %> <%= render 'edit' %>