effective_assets 1.4.4 → 1.4.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1fcdebea3667fcd0b685eca34f302fa1c5ebe1f
|
4
|
+
data.tar.gz: d1a1fa5ef1411daaa764eaed86668da9d2a8909e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e8313d1a73003ea04a41b9164945270193bf30907525712730ec9614cadc9776f3a36e0afa6bd15fe54dd26024c700bfd0d492d919c8d31c359a8bf9d8781020
|
7
|
+
data.tar.gz: 41d2427c43c0461a0fe4c005cf21de28c364fec1328d4d3e6b5c3024d3f9e6ba3cb85e08f9c992ba03c5df774f88ac72861d7a1a1907b32101e05c6222d2455d
|
@@ -3,34 +3,22 @@ $(document).on 's3_file_added', (event, file) ->
|
|
3
3
|
obj.closest('.error').removeClass('error')
|
4
4
|
obj.parent().siblings('.help-inline,.inline-errors').remove()
|
5
5
|
|
6
|
-
$(document).on 's3_uploads_complete', (_, uploader) ->
|
6
|
+
$(document).on 's3_uploads_complete', (_, uploader) ->
|
7
7
|
uploader.closest('.asset-box-input').find('.filter-attachments').val('')
|
8
8
|
|
9
|
-
$(document).on 's3_upload_failed', (_, uploader, content) ->
|
9
|
+
$(document).on 's3_upload_failed', (_, uploader, content) ->
|
10
10
|
uploader.closest('.asset-box-input').find('.filter-attachments').val('')
|
11
11
|
alert("An error occurred while uploading #{content.filename}.\n\nThe returned error message is: '#{content.error_thrown}'\n\nPlease try again.")
|
12
12
|
|
13
13
|
$(document).on 'click', 'a.attachment-remove', (event) ->
|
14
14
|
event.preventDefault()
|
15
|
-
|
16
|
-
|
17
|
-
attachment_div.find('input.asset-box-remove').first().val(1)
|
18
|
-
attachment_div.hide()
|
19
|
-
|
20
|
-
# Show the first 'limit' attachments, hide the rest
|
21
|
-
asset_box_input = attachment_div.closest('div.asset-box-input')
|
22
|
-
limit = asset_box_input.data('limit')
|
23
|
-
|
24
|
-
asset_box_input.find("input.asset-box-remove").each (index) ->
|
25
|
-
if "#{$(this).val()}" == '1' # If we're going to delete it...
|
26
|
-
$(this).closest('.attachment').hide()
|
27
|
-
limit = limit + 1
|
28
|
-
return
|
29
|
-
|
30
|
-
if index >= limit
|
31
|
-
$(this).closest('.attachment').hide()
|
32
|
-
else
|
33
|
-
$(this).closest('.attachment').show()
|
15
|
+
$attachmentDiv = $(event.target).closest('.attachment')
|
34
16
|
|
17
|
+
$attachmentDiv.find('input.asset-box-remove').first().val(1)
|
18
|
+
$attachmentDiv.hide()
|
35
19
|
|
20
|
+
# Correct the attachment count
|
21
|
+
$assetBoxInput = $attachmentDiv.closest('div.asset-box-input')
|
22
|
+
count = parseInt($assetBoxInput.attr('data-attachment-count'), 10)
|
23
|
+
$assetBoxInput.attr('data-attachment-count', count - 1)
|
36
24
|
|