dom-rb 0.1.5 → 0.1.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 +4 -4
- data/csr/dom/builder/helpers.rb +12 -14
- data/csr/dom/util.rb +8 -7
- data/lib/dom/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2a1e4262174591a71793ff83f613266799532cef
|
4
|
+
data.tar.gz: e3446a6022ed4daef1a4d0baa819bdfc5d502d52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 849d13f0b39045e93dac4887de8e254ed34e3e5076abd21a806ac9a8c74140b882fa2000bd9c06cbc51d39513b8810e72c0b174cf94a9bf6a8761c5d5c702212
|
7
|
+
data.tar.gz: 6dc0612437026220e2015338cf050de46a0df7d7dcd9b690f8c164c68650d626c4a02e839343426e49f1488289d870d3f2718f7717cb02b1fc6437099476c44b
|
data/csr/dom/builder/helpers.rb
CHANGED
@@ -80,41 +80,41 @@ module CSR
|
|
80
80
|
)
|
81
81
|
end
|
82
82
|
|
83
|
-
def remove_sign_icon(callback: nil, tooltip: nil, popover: nil)
|
83
|
+
def remove_sign_icon(callback: nil, attributes: nil, tooltip: nil, popover: nil)
|
84
84
|
icon(
|
85
85
|
:remove_sign,
|
86
86
|
callback: callback,
|
87
|
-
attributes: { style: {color: 'red'} },
|
87
|
+
attributes: merge_attributes({ style: {color: 'red'} }, attributes),
|
88
88
|
tooltip: tooltip,
|
89
89
|
popover: popover
|
90
90
|
)
|
91
91
|
end
|
92
92
|
|
93
|
-
def refresh_icon(callback: nil, tooltip: nil, popover: nil)
|
93
|
+
def refresh_icon(callback: nil, attributes: nil, tooltip: nil, popover: nil)
|
94
94
|
icon(
|
95
95
|
:refresh,
|
96
96
|
callback: callback,
|
97
|
-
attributes: { style: {color: 'inherit'} },
|
97
|
+
attributes: merge_attributes({ style: { color: 'inherit' } }, attributes),
|
98
98
|
tooltip: tooltip,
|
99
99
|
popover: popover
|
100
100
|
)
|
101
101
|
end
|
102
102
|
|
103
|
-
def save_icon(callback: nil, tooltip: nil, popover: nil)
|
103
|
+
def save_icon(callback: nil, attributes: nil, tooltip: nil, popover: nil)
|
104
104
|
icon(
|
105
105
|
:save,
|
106
106
|
callback: callback,
|
107
|
-
attributes: { style: {color: 'inherit'} },
|
107
|
+
attributes: merge_attributes({ style: { color: 'inherit' } }, attributes),
|
108
108
|
tooltip: tooltip,
|
109
109
|
popover: popover
|
110
110
|
)
|
111
111
|
end
|
112
112
|
|
113
|
-
def hamburger_icon(callback: nil, tooltip: nil, popover: nil)
|
113
|
+
def hamburger_icon(callback: nil, attributes: nil, tooltip: nil, popover: nil)
|
114
114
|
icon(
|
115
115
|
:menu_hamburger,
|
116
116
|
callback: callback,
|
117
|
-
attributes: { style: {color: 'inherit'} },
|
117
|
+
attributes: merge_attributes({ style: { color: 'inherit' } }, attributes),
|
118
118
|
tooltip: tooltip,
|
119
119
|
popover: popover
|
120
120
|
)
|
@@ -134,17 +134,15 @@ module CSR
|
|
134
134
|
if menu_attributes
|
135
135
|
_menu_attributes = merge_attributes(_menu_attributes, menu_attributes)
|
136
136
|
end
|
137
|
-
|
138
|
-
:div,
|
137
|
+
div(
|
139
138
|
attributes: {
|
140
139
|
class: 'dropdown',
|
141
140
|
},
|
142
141
|
content: [
|
143
|
-
|
144
|
-
:div,
|
142
|
+
div(
|
145
143
|
attributes: {
|
146
144
|
class: 'dropdown-toggle',
|
147
|
-
data_toggle: 'dropdown'
|
145
|
+
data_toggle: 'dropdown',
|
148
146
|
},
|
149
147
|
content: icon(
|
150
148
|
icon,
|
@@ -228,7 +226,7 @@ module CSR
|
|
228
226
|
font_size: 'smaller',
|
229
227
|
margin_left: '0.5em',
|
230
228
|
margin_right: '0.5em',
|
231
|
-
|
229
|
+
margin_top: '0.3em',
|
232
230
|
color: 'inherit',
|
233
231
|
background_color: 'inherit',
|
234
232
|
}.merge(
|
data/csr/dom/util.rb
CHANGED
@@ -49,18 +49,19 @@ module CSR
|
|
49
49
|
result
|
50
50
|
end
|
51
51
|
|
52
|
-
# args are hashes, lowest to highest precedence
|
53
|
-
#
|
52
|
+
# args are hashes, lowest to highest precedence,
|
53
|
+
# i.e. later args override earlier args
|
54
|
+
# goes deep recursively
|
54
55
|
def merge_attributes(*args)
|
55
56
|
result = args[0] || {}
|
56
57
|
args.each do |arg|
|
57
58
|
if arg
|
58
|
-
arg.each_pair do |
|
59
|
-
|
60
|
-
if Hash
|
61
|
-
result[
|
59
|
+
arg.each_pair do |key, next_value|
|
60
|
+
current_value = result[key]
|
61
|
+
if Hash === current_value && Hash === next_value
|
62
|
+
result[key] = merge_attributes(current_value, next_value)
|
62
63
|
else
|
63
|
-
result[
|
64
|
+
result[key] = next_value
|
64
65
|
end
|
65
66
|
end
|
66
67
|
end
|
data/lib/dom/version.rb
CHANGED