弹框位置调整

This commit is contained in:
huang 2016-02-20 10:59:49 +08:00
parent aa22a253ba
commit 534d93de77
4 changed files with 6 additions and 4 deletions

View File

@ -212,7 +212,7 @@ class AttachmentsController < ApplicationController
@history.version = @old_history.nil? ? 1 : @old_history.version + 1 @history.version = @old_history.nil? ? 1 : @old_history.version + 1
@history.save #历史记录保存完毕 @history.save #历史记录保存完毕
#将最新保存的记录 数据替换到 需要修改的文件记录 #将最新保存的记录 数据替换到 需要修改的文件记录
@old_attachment.attributes = @attachment.attributes.dup.except("id","container_id","container_type","is_public") @old_attachment.attributes = @attachment.attributes.dup.except("id","container_id","container_type","is_public","downloads")
@old_attachment.save @old_attachment.save
#删除当前记录 #删除当前记录
@attachment.delete @attachment.delete

View File

@ -14,7 +14,9 @@
<div style="max-height: 95px;overflow-y:auto; background-color: #e3e3e3;" class="mb10 p10"> <div style="max-height: 95px;overflow-y:auto; background-color: #e3e3e3;" class="mb10 p10">
<% @attachment_histories.each do |history| %> <% @attachment_histories.each do |history| %>
<span class="attachment"> <span class="attachment">
<input readonly="readonly" name="attachments_versions_<%= history.id%>" value="<%=history.filename%>" class="upload_filename readonly" type="text"> <%= link_to truncate(history.filename,length: 35, omission: '...'),
download_named_attachment_path(history.attachment.id, history.filename),
:title => history.filename+"\n"+history.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "linkBlue f_14 f_b" %>
<span>版本号:<%= history.version %></span> <span>版本号:<%= history.version %></span>
</span> </span>

View File

@ -2,6 +2,6 @@ $("#ajax-modal").html('<%= escape_javascript( render :partial => 'attachments/sh
showModal('ajax-modal', '452px'); showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>"); $('#ajax-modal').before("<a href='javascript:void(0)' onclick='hideModal();' style='margin-left: 435px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","46%"); $('#ajax-modal').parent().css("top","40%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup"); $('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");

View File

@ -21,7 +21,7 @@
showModal('ajax-modal', '452px'); showModal('ajax-modal', '452px');
$('#ajax-modal').siblings().remove(); $('#ajax-modal').siblings().remove();
$('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>"); $('#ajax-modal').before("<a href='javascript:void(0)' onclick='closeModal();' style='margin-left: 435px;' class='resourceClose'></a>");
$('#ajax-modal').parent().css("top","40%").css("left","46%"); $('#ajax-modal').parent().css("top","50%").css("left","50%");
$('#ajax-modal').parent().addClass("resourceUploadPopup"); $('#ajax-modal').parent().addClass("resourceUploadPopup");
$('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px"); $('#ajax-modal').css("padding-left","16px").css("padding-bottom","16px");
} }