effective_bootstrap 0.0.12 → 0.0.13

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: 21cb74427ba892b8619697fdbc5326ba5501f5af
4
- data.tar.gz: c4a4e3c701a95d3ead37342482f062ad38f81da6
3
+ metadata.gz: 4af69c9c4a9ae59f62bedf31c4cdbe3a4e737a9b
4
+ data.tar.gz: 8e8deb930540714b3cf8a5f925ff4071203641bf
5
5
  SHA512:
6
- metadata.gz: 299e0d77e352e6fd9ca97c619896dec1ad9c85c215ee3eff0c4ea367992f1b52627b99a85e25e532b465b4a9e75661bac23d1204ecda6576c8cea9b284c4cd55
7
- data.tar.gz: 71a77943a61d77d15fe376e89f76ca5bc32bbe8c9fd360dd4344f52e0f723f05f72b7a11eef7847f91d37133d343eef5791c6c165ea17b6c9087611f33d053a5
6
+ metadata.gz: 136e7e09f5a6dbd8b1a646c79c80ae0df121a2a58dbe3c2c4aaa52f8aded515d6c07b4e3215938156809f8914f5e908f1bfbfe2febc00c1821f3919ea2c21108
7
+ data.tar.gz: a12111fae308ef8504516805bd37d5d40004633133a255b77cf9a3b4f7e3b047f4ca94ce84dfcd3fe74da7254a5aef080412fd8c761bdc6cfecf86cf3a9757c4
@@ -13,7 +13,7 @@
13
13
  .form-actions-inline.justify-content-end {
14
14
  margin-left: 0.5em;
15
15
 
16
- svg {
16
+ > svg {
17
17
  position: absolute;
18
18
  left: -1.6em;
19
19
  }
@@ -22,7 +22,7 @@
22
22
  .form-actions-inline.justify-content-start {
23
23
  margin-right: 0.5em;
24
24
 
25
- svg {
25
+ > svg {
26
26
  position: absolute;
27
27
  right: -1.6em;
28
28
  }
@@ -3,13 +3,20 @@ module Effective
3
3
  class Save < Effective::FormInput
4
4
 
5
5
  def to_html(&block)
6
- content_tag(:button, name, options[:input])
6
+ content_tag(:button, options[:input]) do
7
+ icon_name.present? ? (icon(icon_name) + name) : name
8
+ end
7
9
  end
8
10
 
9
11
  def input_html_options
10
12
  { class: 'btn btn-primary', type: 'submit', name: 'commit', value: name }
11
13
  end
12
14
 
15
+ def icon_name
16
+ return @icon unless @icon.nil?
17
+ @icon = options[:input].delete(:icon) || ''.html_safe
18
+ end
19
+
13
20
  end
14
21
  end
15
22
  end
@@ -11,7 +11,15 @@ module Effective
11
11
  icon('check', style: 'display: none;'),
12
12
  icon('x', style: 'display: none;'),
13
13
  icon('spinner'),
14
- (block_given? ? capture(&block) : content_tag(:button, name, options[:input]))
14
+ (
15
+ if block_given?
16
+ capture(&block)
17
+ else
18
+ content_tag(:button, options[:input]) do
19
+ icon_name.present? ? (icon(icon_name) + name) : name
20
+ end
21
+ end
22
+ )
15
23
  ]
16
24
 
17
25
  (left? ? tags.reverse.join : tags.join).html_safe
@@ -69,6 +77,11 @@ module Effective
69
77
  @right = (options.delete(:right) || false)
70
78
  end
71
79
 
80
+ def icon_name
81
+ return @icon unless @icon.nil?
82
+ @icon = options[:input].delete(:icon) || ''.html_safe
83
+ end
84
+
72
85
  def feedback_options
73
86
  # case layout
74
87
  # when :inline
@@ -1,3 +1,3 @@
1
1
  module EffectiveBootstrap
2
- VERSION = '0.0.12'.freeze
2
+ VERSION = '0.0.13'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: effective_bootstrap
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.12
4
+ version: 0.0.13
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: 2018-04-27 00:00:00.000000000 Z
11
+ date: 2018-05-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails