empty() .attachment (remove spaces) to keep css working, thanks @mrflix :-o
This commit is contained in:
parent
0521aeed11
commit
94a9b5e004
2 changed files with 18 additions and 2 deletions
|
@ -730,6 +730,8 @@ class App.ControllerForm extends App.Controller
|
||||||
item
|
item
|
||||||
)
|
)
|
||||||
store_id = $(e.currentTarget).data('id')
|
store_id = $(e.currentTarget).data('id')
|
||||||
|
|
||||||
|
# delete attachment from storage
|
||||||
App.Ajax.request(
|
App.Ajax.request(
|
||||||
type: 'DELETE'
|
type: 'DELETE'
|
||||||
url: App.Config.get('api_path') + '/ticket_attachment_upload'
|
url: App.Config.get('api_path') + '/ticket_attachment_upload'
|
||||||
|
@ -737,7 +739,13 @@ class App.ControllerForm extends App.Controller
|
||||||
processData: false
|
processData: false
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
)
|
)
|
||||||
$(e.currentTarget).closest('.attachment').empty()
|
|
||||||
|
# remove attachment from dom
|
||||||
|
element = $(e.currentTarget).closest('.attachments')
|
||||||
|
$(e.currentTarget).closest('.attachment').remove()
|
||||||
|
# empty .attachment (remove spaces) to keep css working, thanks @mrflix :-o
|
||||||
|
if element.find('.attachment').length == 0
|
||||||
|
element.empty()
|
||||||
)
|
)
|
||||||
|
|
||||||
@attachments = []
|
@attachments = []
|
||||||
|
|
|
@ -1089,6 +1089,8 @@ class Edit extends App.Controller
|
||||||
item
|
item
|
||||||
)
|
)
|
||||||
store_id = $(e.currentTarget).data('id')
|
store_id = $(e.currentTarget).data('id')
|
||||||
|
|
||||||
|
# delete attachment from storage
|
||||||
App.Ajax.request(
|
App.Ajax.request(
|
||||||
type: 'DELETE'
|
type: 'DELETE'
|
||||||
url: App.Config.get('api_path') + '/ticket_attachment_upload'
|
url: App.Config.get('api_path') + '/ticket_attachment_upload'
|
||||||
|
@ -1096,7 +1098,13 @@ class Edit extends App.Controller
|
||||||
processData: false
|
processData: false
|
||||||
success: (data, status, xhr) =>
|
success: (data, status, xhr) =>
|
||||||
)
|
)
|
||||||
$(e.currentTarget).closest('.attachment').empty()
|
|
||||||
|
# remove attachment from dom
|
||||||
|
element = $(e.currentTarget).closest('.attachments')
|
||||||
|
$(e.currentTarget).closest('.attachment').remove()
|
||||||
|
# empty .attachment (remove spaces) to keep css working, thanks @mrflix :-o
|
||||||
|
if element.find('.attachment').length == 0
|
||||||
|
element.empty()
|
||||||
)
|
)
|
||||||
|
|
||||||
reset: (e) =>
|
reset: (e) =>
|
||||||
|
|
Loading…
Reference in a new issue