maglove-widgets 1.0.7 → 1.0.8

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: f5116cc57335d646ebca02813035b21c6d30316e
4
- data.tar.gz: 63241901958d95325d1d7cf9d97a9af48f453812
3
+ metadata.gz: f7db710a45299148112796c1a5b59df8edd93c4d
4
+ data.tar.gz: c33fb44c51b38f26856ebdb2d0f937aaa79afaff
5
5
  SHA512:
6
- metadata.gz: 32eb0c139f0f1d21572e187370282d1c4738e1a3c02a9a4de33fad48d43a2da1c2361b8f75267e2088bcfe13330a91114bdcb7dc1c887b19b1acd3deb735cdb1
7
- data.tar.gz: 81b0f0c926f9d14bf36416d819fdbd15acf53a0f4022511c473d4ad140c2afe748d66e7438adca8edf442a54fb74dcb6e80ce9b256ae6a84d412e90cbf22870b
6
+ metadata.gz: ee5ae5b3a8a7a7a8a5df4f7946d53e0e9a44e95951732493c44237bf500730293fe5e41e57e52ea5d70d00be9c8a433c8430e3aba5801c3e21dd264ca6f4b49b
7
+ data.tar.gz: acceb03e2e14401ec78d42b9979b84bcfc53796c39503056da18ba307b1a8540bfef4fffcef3f0bd4e9b1c1d6b3c7393e32cf4e9f5d878ba57bbb32b26405355
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- maglove-widgets (1.0.7)
4
+ maglove-widgets (1.0.8)
5
5
  bundler (~> 1.14)
6
6
  hamloft (~> 0.2)
7
7
 
@@ -27,4 +27,4 @@ DEPENDENCIES
27
27
  maglove-widgets!
28
28
 
29
29
  BUNDLED WITH
30
- 1.14.6
30
+ 1.15.1
@@ -7,29 +7,31 @@ module Maglove
7
7
 
8
8
  def defaults
9
9
  {
10
- animate: "none",
11
- image_source: false,
12
- image_position: "center_center",
13
- image_size: "cover",
14
- parallax_effect: "none",
15
- background_color: "",
16
- bg_color: "",
17
- opacity: "",
18
- border_radius: "",
19
- border_width: "",
20
- border_style: "",
21
- style: "default",
22
- padding_top: "",
23
- padding_right: "",
24
- padding_bottom: "",
25
- padding_left: "",
26
- min_height: "",
27
- max_height: "",
28
- margin_top: "",
29
- margin_right: "",
30
- margin_bottom: "",
31
- margin_left: "",
32
- overflow_y: ""
10
+ animate: "none",
11
+ image_source: false,
12
+ image_position: "center_center",
13
+ image_size: "cover",
14
+ parallax_effect: "none",
15
+ background_color: "",
16
+ bg_color: "",
17
+ opacity: "",
18
+ border_radius: "",
19
+ border_width: "",
20
+ border_style: "",
21
+ style: "default",
22
+ padding_top: "",
23
+ padding_right: "",
24
+ padding_bottom: "",
25
+ padding_left: "",
26
+ alignment: "center",
27
+ min_height: "",
28
+ max_height: "",
29
+ max_width: "",
30
+ margin_top: "",
31
+ margin_right: "",
32
+ margin_bottom: "",
33
+ margin_left: "",
34
+ overflow_y: ""
33
35
  }
34
36
  end
35
37
 
@@ -57,15 +59,28 @@ module Maglove
57
59
  sb.add(:background_color, @options[:background_color] == "custom" ? @options[:bg_color] : nil)
58
60
  if @options[:background_color] == "overlay"
59
61
  sb.add(:background_image, @options[:image_source], "linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url(<%= value %>)")
60
- else
61
- sb.add(:background_image, @options[:image_source], "url(<%= value %>)")
62
62
  end
63
63
  sb.add(:background_position, @options[:image_position], "<%= value.split('_').join(' ') %>")
64
64
  end
65
65
  end
66
66
 
67
67
  def image_styles
68
- style_string @options, :min_height, :max_height, :padding, :overflow_y
68
+ if @options[:alignment] == "left"
69
+ @options[:margin_left] = "0"
70
+ @options[:margin_right] = "auto"
71
+ elsif @options[:alignment] == "right"
72
+ @options[:margin_left] = "auto"
73
+ @options[:margin_right] = "0"
74
+ else
75
+ @options[:margin_left] = "auto"
76
+ @options[:margin_right] = "auto"
77
+ end
78
+
79
+ style_string @options, :min_height, :max_height, :max_width, :padding, :overflow_y, :margin_left, :margin_right do |sb|
80
+ if @options[:background_color] != "overlay"
81
+ sb.add(:background_image, @options[:image_source], "url(<%= value %>)")
82
+ end
83
+ end
69
84
  end
70
85
 
71
86
  module Helpers
@@ -82,4 +97,4 @@ module Maglove
82
97
  end
83
98
  end
84
99
  end
85
- end
100
+ end
@@ -3,7 +3,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "maglove-widgets"
6
- s.version = "1.0.7"
6
+ s.version = "1.0.8"
7
7
  s.licenses = ["BSD-3-Clause"]
8
8
  s.platform = Gem::Platform::RUBY
9
9
  s.authors = ["Tobias Strebitzer"]
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: maglove-widgets
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.7
4
+ version: 1.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tobias Strebitzer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-07 00:00:00.000000000 Z
11
+ date: 2017-08-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -86,7 +86,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
86
86
  version: '0'
87
87
  requirements: []
88
88
  rubyforge_project:
89
- rubygems_version: 2.6.10
89
+ rubygems_version: 2.5.2
90
90
  signing_key:
91
91
  specification_version: 4
92
92
  summary: MagLove Widgets Repository