资源库

This commit is contained in:
lizanle 2015-08-18 17:26:39 +08:00
parent ae6260571b
commit 43d57074e5
2 changed files with 4 additions and 3 deletions

View File

@ -894,7 +894,7 @@ class UsersController < ApplicationController
# format.js
# end
if @flag
render :text=>'sucess'
render :text=> download_named_attachment_path(@attachment.id, @attachment.filename)
else
render :text=>'fail'
end

View File

@ -158,7 +158,7 @@ $(".resourcesList").click(function(e) {
//将当前行改变为白色
line.children().css("background-color", 'white');
//当前行恢复编辑状态到链接状态
if(ele.nodeName != 'INPUT') {
if(ele && ele.nodeName != 'INPUT') {
restore();
}
line = null;
@ -224,9 +224,10 @@ $(".resourcesList").click(function(e) {
'<%=rename_resource_user_path(@user) %>',
$("#res_name_form").serialize(),
function (data){
if(data =='sucess'){//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变
if(data != 'fail'){//修改成功,那么将链接恢复,并且将链接的显示内容改变。链接可以不变
last_line.children().first().html(res_link);
last_line.children().first().children().attr('title',name);
last_line.children().first().children().attr('href',data);
last_line.children().first().children().html(name.length > 17? name.substring(0,17)+'...' : name);
}else{
last_line.children().first().html(res_link);