Improved error handling of upload feature.
This commit is contained in:
parent
943d015ae9
commit
7a0e95014c
1 changed files with 19 additions and 17 deletions
|
@ -664,23 +664,25 @@ class App.ControllerForm extends App.Controller
|
|||
|
||||
# add file uploader
|
||||
u = =>
|
||||
@el.find('#' + fileUploaderId ).fineUploader(
|
||||
request:
|
||||
endpoint: App.Config.get('api_path') + '/ticket_attachment_new'
|
||||
params:
|
||||
form_id: @form_id
|
||||
text:
|
||||
uploadButton: '<i class="glyphicon glyphicon-paperclip"></i>'
|
||||
template: '<div class="qq-uploader">' +
|
||||
'<pre class="btn qq-upload-icon qq-upload-drop-area"><span>{dragZoneText}</span></pre>' +
|
||||
'<div class="btn btn-default qq-upload-icon2 qq-upload-button pull-right" style="">{uploadButtonText}</div>' +
|
||||
'<ul class="qq-upload-list span5" style="margin-top: 10px;"></ul>' +
|
||||
'</div>',
|
||||
classes:
|
||||
success: ''
|
||||
fail: ''
|
||||
debug: false
|
||||
)
|
||||
# only add upload item if html element exists
|
||||
if @el.find('#' + fileUploaderId )[0]
|
||||
@el.find('#' + fileUploaderId ).fineUploader(
|
||||
request:
|
||||
endpoint: App.Config.get('api_path') + '/ticket_attachment_new'
|
||||
params:
|
||||
form_id: @form_id
|
||||
text:
|
||||
uploadButton: '<i class="glyphicon glyphicon-paperclip"></i>'
|
||||
template: '<div class="qq-uploader">' +
|
||||
'<pre class="btn qq-upload-icon qq-upload-drop-area"><span>{dragZoneText}</span></pre>' +
|
||||
'<div class="btn btn-default qq-upload-icon2 qq-upload-button pull-right" style="">{uploadButtonText}</div>' +
|
||||
'<ul class="qq-upload-list span5" style="margin-top: 10px;"></ul>' +
|
||||
'</div>',
|
||||
classes:
|
||||
success: ''
|
||||
fail: ''
|
||||
debug: false
|
||||
)
|
||||
App.Delay.set( u, 100, undefined, 'form_upload' )
|
||||
|
||||
# article
|
||||
|
|
Loading…
Reference in a new issue