fix javascript disable checkbox failed after cate and tags being reloaded.

This commit is contained in:
Fu Matthew 2013-02-23 11:34:47 +08:00
parent 9fec7beb47
commit d6dd38744b
7 changed files with 14 additions and 6 deletions

View File

@ -11,7 +11,11 @@ function update_cates_and_tags()
}); });
} }
function rebind(){
$("#widget_data_source_category,#widget_data_source_tag,#app_page_category,#app_page_tag").find('input').change(function(){update_cates_and_tags()});
}
$(document).ready(function(){ $(document).ready(function(){
update_cates_and_tags(); update_cates_and_tags();
$("#widget_data_source_category,#widget_data_source_tag,#app_page_category,#app_page_tag").find('input').change(function(){update_cates_and_tags()}); rebind();
}); });

View File

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

View File

@ -6,6 +6,4 @@
<%= render 'edit' %> <%= render 'edit' %>
<%=javascript_include_tag "inc/update_cates_and_tags.js" %>

View File

@ -16,3 +16,5 @@
$('#widget_setting').html("<%=j render :partial=> 'reset',:locals=>{:label_i18n=>'default_widget.select_widget_style'}%>"); $('#widget_setting').html("<%=j render :partial=> 'reset',:locals=>{:label_i18n=>'default_widget.select_widget_style'}%>");
$('#widget_list select').html("<%= j options_for_select([]) %>"); $('#widget_list select').html("<%= j options_for_select([]) %>");
<% end %> <% end %>
update_cates_and_tags();
rebind();

View File

@ -109,3 +109,4 @@
</div> </div>
</div> </div>
<%=javascript_include_tag "inc/update_cates_and_tags.js" %>

View File

@ -3,5 +3,4 @@
<%= render 'admin/items/site_map_left_bar' %> <%= render 'admin/items/site_map_left_bar' %>
<% end -%> <% end -%>
<%= render 'edit' %> <%= render 'edit' %>
<%=javascript_include_tag "inc/update_cates_and_tags.js" %>

View File

@ -31,3 +31,5 @@
$('#app_page_url').html("<%= t('default_widget.no_support_setting')%>"); $('#app_page_url').html("<%= t('default_widget.no_support_setting')%>");
$('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>"); $('#frontend_setting').html("<%= j render :partial => 'custom_frontend_setting' %>");
<% end %> <% end %>
update_cates_and_tags();
rebind();