socialforge/app/views/my/save_user_avatar.js.erb

14 lines
930 B
Plaintext
Raw Normal View History

<% if @user %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_source_tx',:style=>"width:78px;height:78px;overflow:hidden",:alt=>"头像") %>');
2015-08-19 17:14:19 +08:00
$("#nh_user_logo").replaceWith('<%= image_tag(url_to_avatar(@user), :id=>'nh_user_logo',:width =>"40",:height => "40",:alt=>"头像") %>');
<% elsif @course %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@course), :id=>'nh_source_tx',:style=>"width:96px;height:96px;overflow:hidden",:alt=>"班级logo") %>');
if($("#course_avatar_form").length > 0) {
window.location.href = "<%=settings_course_path(@course) %>";
}
<% elsif @project %>
$("#nh_source_tx").replaceWith('<%= image_tag(url_to_avatar(@project), :id=>'nh_source_tx',:style=>"width:60px;height:60px;overflow:hidden",:alt=>"项目logo") %>');
if($("#project_avatar_form").length > 0) {
window.location.href = "<%=settings_project_path(@project) %>";
}<% end %>
2015-07-09 15:27:49 +08:00
hideModal();