修改上传附件删除按钮的位置

This commit is contained in:
daiao 2017-08-25 19:56:17 +08:00
parent 57722df834
commit ef0da2ebf6
3 changed files with 10 additions and 2 deletions

View File

@ -450,6 +450,13 @@ module ApplicationHelper
return time
end
def judge_Chinese_num str
cn_reg = /[\u4e00-\u9fa5]{1}/
cn_number = str.scan(cn_reg).size
en_number = str.size - cn_number
size = 1.9* cn_number + en_number
end
# homework_common状态
# 0挂起1提交中2匿评中3评阅中
def new_homework_common_status status

View File

@ -5,7 +5,8 @@
<span class="attachment" id="attachments_p<%= i %>">
<label class="panel-form-label fl">&nbsp;</label>
<i class="fa fa-folder mr5 color-light-grey" aria-hidden="true"></i>
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'readonly hidden atta_input', :style => 'border:none; max-width:980px;', :readonly=>'readonly')%>
<% size = judge_Chinese_num attachment.filename %>
<%= text_field_tag("attachments[p#{i}][filename]", attachment.filename, :class => 'upload_filename readonly hidden', :size => size, :style => 'border:none; max-width:980px;white-space: nowrap; text-overflow:ellipsis;font-family: Consolas;', :readonly=>'readonly')%>
<%= text_field_tag("attachments[p#{i}][description]", attachment.description, :maxlength => 254, :placeholder => l(:label_optional_description), :class => 'description', :style=>"display: inline-block;") %>
<span class="ispublic-label"><%= l(:field_is_public)%>:</span>
<%= check_box_tag("attachments[p#{i}][is_public_checkbox]", attachment.is_public,attachment.is_public == 1 ? true : false,:class => 'is_public')%>

View File

@ -177,7 +177,7 @@ function addFile(inputEl, file, eagerUpload,btnId) {
var ch = file.name[i];
var judge = regex.test(ch);
if(regex.test(ch)){
iSize += 1.8;
iSize += 1.9;
}else{
iSize += 1;
}