css_grid 2.6.1 → 2.6.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -649,14 +649,6 @@ Need to test it with the most commons versions of grid stylesheets (twitter boot
649
649
 
650
650
  Preprend and Append are not fully handled by the GRID_CONFIG constant. Specialy prepend negative values.
651
651
 
652
- ## Bugfix comming soon
653
-
654
- Prepend with negative value doesn't work.
655
-
656
- --
657
-
658
- class .row in the grid.css will be updated to delete 'overflow: hidden;' property
659
-
660
652
  ## Contributing
661
653
 
662
654
  1. Fork it
@@ -1,3 +1,3 @@
1
1
  module CssGrid
2
- VERSION = "2.6.1"
2
+ VERSION = "2.6.2"
3
3
  end
data/lib/css_grid.rb CHANGED
@@ -20,21 +20,29 @@ module GridHelper
20
20
  value.class == Proc ? value.call(@elt) : value
21
21
  end
22
22
 
23
- prepend = if options[:prepend].present?
24
- if options[:prepend] > 0
25
- TWELVE_STRING_INTS_INVERT[options.delete :prepend]
23
+ prepend = if options[:prepend].present? and TWELVE_STRING_INTS_INVERT.has_key? (prepend = options.delete(:prepend)).abs
24
+ if prepend > 0
25
+ "#{ GRID_CONFIG[:classes][:prepend] }_#{ TWELVE_STRING_INTS_INVERT[prepend] }"
26
26
  else
27
- "minus_#{ TWELVE_STRING_INTS_INVERT[options.delete :prepend] }"
27
+ "#{ GRID_CONFIG[:classes][:minus] }_#{ TWELVE_STRING_INTS_INVERT[prepend.abs] }"
28
28
  end
29
+ elsif prepend
30
+ warn "WARNING : invalid value for ':prepend'"
29
31
  end
30
- append = TWELVE_STRING_INTS_INVERT[options.delete :append]
32
+
33
+ append = if options[:append].present? and TWELVE_STRING_INTS_INVERT.has_key? (append = options.delete(:append))
34
+ "#{ GRID_CONFIG[:classes][:append] }_#{ TWELVE_STRING_INTS_INVERT[options.delete :append] }"
35
+ elsif append
36
+ warn "WARNING : invalid value for ':append'"
37
+ end
38
+
31
39
 
32
40
  warn "WARNING : argument ':nested' is not supported for '#{ tag }'" if options[:nested].present? and tag != :row
33
41
 
34
42
  if tag =~ /(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)_span$/
35
- @nested_stack << $1
43
+ @nested_stack << $1
36
44
 
37
- unstack = true
45
+ unstack = true
38
46
  else
39
47
  warn "WARNING : argument ':prepend' is not supported for '#{ tag }'" if prepend.present?
40
48
  warn "WARNING : argument ':append' is not supported for '#{ tag }'" if append.present?
@@ -42,9 +50,7 @@ module GridHelper
42
50
  unstack = false
43
51
  end
44
52
 
45
- content_class = [GRID_CONFIG[:classes][tag], options.delete(:class)].compact
46
- content_class << "#{ GRID_CONFIG[:classes][:prepend] }_#{ prepend }" if prepend
47
- content_class << "#{ GRID_CONFIG[:classes][:append] }_#{ append }" if append
53
+ content_class = [GRID_CONFIG[:classes][tag], options.delete(:class), prepend, append].compact
48
54
  content_class << GRID_CONFIG[:classes][:nested] if options.delete(:nested)
49
55
  options.merge! :class => content_class.join(" ")
50
56
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: css_grid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.1
4
+ version: 2.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: