effective_assets 1.4.5 → 1.4.6

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: c1fcdebea3667fcd0b685eca34f302fa1c5ebe1f
4
- data.tar.gz: d1a1fa5ef1411daaa764eaed86668da9d2a8909e
3
+ metadata.gz: c87aaa1f7bea793889c220aa1a78764d0a7f6bb1
4
+ data.tar.gz: ec17d7a9054ea3b8de1bd533bd8612f362f299a5
5
5
  SHA512:
6
- metadata.gz: e8313d1a73003ea04a41b9164945270193bf30907525712730ec9614cadc9776f3a36e0afa6bd15fe54dd26024c700bfd0d492d919c8d31c359a8bf9d8781020
7
- data.tar.gz: 41d2427c43c0461a0fe4c005cf21de28c364fec1328d4d3e6b5c3024d3f9e6ba3cb85e08f9c992ba03c5df774f88ac72861d7a1a1907b32101e05c6222d2455d
6
+ metadata.gz: 48e653a86aea67db00958a15bfc91b96daf223f091bf3148b3a876e0ed67ad31cf2de1dfedb220d805e482c87642dae9a14ec19e523a14fb54601f530514f173
7
+ data.tar.gz: 9764b9185790dac272758a48d481d41e4319c7eee88672b02b2bc450d9aacf40d2b742f8c905a11233ed5ba34ae7fea6039ce19706bb3b4727f47426f2b9706c
@@ -37,7 +37,7 @@ $.fn.S3Uploader = (options) ->
37
37
  # Make sure the user isn't over the upload limit
38
38
  $asset_box = $uploadForm.closest('.asset-box-input')
39
39
  limit = $asset_box.data('limit')
40
- if typeof limit == 'number'
40
+ if typeof limit == 'number' && limit > 1
41
41
  count = parseInt($asset_box.attr('data-attachment-count'), 10)
42
42
  if count >= limit
43
43
  alert("Unable to add file(s). You have exceeded the limit of #{limit} uploads.") unless $asset_box.data('over-limit-alerted')
@@ -290,6 +290,7 @@ $.fn.S3Uploader = (options) ->
290
290
  $uploadForm.data("key", $uploadForm.find("input[name='key']").val())
291
291
  $uploadForm.data("fileCount", 0)
292
292
  $(document).on 'drop', '.asset-box-uploader', resetOverLimitAlert
293
+ $(document).on 'click', '.asset-box-uploader .asset-box-uploader-fileinput', resetOverLimitAlert
293
294
  setUploadForm()
294
295
  this
295
296
 
@@ -50,17 +50,7 @@ module Inputs
50
50
 
51
51
  def attachments_html
52
52
  if @options[:attachment_style] == :table
53
- content_tag(:table, :class => 'table') do
54
- content_tag(:thead) do
55
- content_tag(:tr) do
56
- [
57
- content_tag(:th, ''),
58
- content_tag(:th, ''),
59
- content_tag(:th, (@options[:table_filter_bar] ? filter_bar_html : ''), :colspan => 2)
60
- ].join().html_safe
61
- end
62
- end + content_tag(:tbody, build_values_html, :class => 'attachments')
63
- end
53
+ attachments_table_html
64
54
  elsif @options[:attachment_style] == :list
65
55
  content_tag(:ul, build_values_html, :class => 'attachments')
66
56
  else
@@ -68,6 +58,26 @@ module Inputs
68
58
  end
69
59
  end
70
60
 
61
+ def attachments_table_html
62
+ content_tag(:table, :class => 'table') do
63
+ head = attachments_table_head_html if @options[:table_filter_bar]
64
+ body = content_tag(:tbody, build_values_html, :class => 'attachments')
65
+ head ? head + body : body
66
+ end
67
+ end
68
+
69
+ def attachments_table_head_html
70
+ content_tag(:thead) do
71
+ content_tag(:tr) do
72
+ [
73
+ content_tag(:th, ''),
74
+ content_tag(:th, ''),
75
+ content_tag(:th, filter_bar_html, :colspan => 2)
76
+ ].join().html_safe
77
+ end
78
+ end
79
+ end
80
+
71
81
  def dialog_html
72
82
  render(
73
83
  :partial => 'asset_box_input/dialog',
@@ -1,3 +1,3 @@
1
1
  module EffectiveAssets
2
- VERSION = '1.4.5'.freeze
2
+ VERSION = '1.4.6'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_assets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.5
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Code and Effect
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-07 00:00:00.000000000 Z
11
+ date: 2015-08-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails