inplace_editing 0.3.12 → 0.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9647f21d4d31d4a44457de3e0d5a4a1ef601f6ef
|
4
|
+
data.tar.gz: 8a8a9d678daec6343e3d26d068bd63e19fc9210d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e361db16f88ac8b429b33a683c34d6a6eae0a139e35ce41b28c265e79a0326133e85dbd5f45889f8269313fd244ce3bd7ad3c1d82d78cc51cb4b26987810fe94
|
7
|
+
data.tar.gz: 49066b9fb5c0cac982d92679236a28e7cbf68e089fdb938616518a93b144e18265fc080d89f80ae273373614aec374625330ab83795b5f3189f86789a5a88a07
|
@@ -23,7 +23,7 @@ module InplaceEditingHelper
|
|
23
23
|
render partial: 'inplace_editing/string', :locals => editor_locals(localized_object, property, place_holder)
|
24
24
|
end
|
25
25
|
|
26
|
-
def image_editor(localized_object, property, place_holder = nil, default_value = nil,
|
26
|
+
def image_editor(localized_object, property, place_holder = nil, default_value = nil, tag_attributes = { })
|
27
27
|
locals = editor_locals(localized_object, property, place_holder, default_value)
|
28
28
|
image_src = default_value
|
29
29
|
if localized_object[property]
|
@@ -31,8 +31,7 @@ module InplaceEditingHelper
|
|
31
31
|
image_src = image_src.url if image.respond_to?(:url)
|
32
32
|
end
|
33
33
|
locals[:image_src] = image_src
|
34
|
-
locals[:
|
35
|
-
locals[:class] = css_class
|
34
|
+
locals[:attrs] = tag_attributes
|
36
35
|
render partial: 'inplace_editing/image', :locals => locals
|
37
36
|
end
|
38
37
|
|
@@ -3,7 +3,10 @@
|
|
3
3
|
= f.input property.to_s + "_cache", as: :hidden
|
4
4
|
.editor-container
|
5
5
|
.image-container style="#{image_src.blank? ? 'display:none' : ''}"
|
6
|
-
|
6
|
+
= content_tag :img do |el|
|
7
|
+
- attrs.each {|key_name, value| el[key_name.to_sym] = value }
|
8
|
+
- el[:class] = el[:class].present? ? (el[:class] + ' preview editable-preview') : 'preview editable-preview'
|
9
|
+
- el[:src] = image_src
|
7
10
|
- if image_src.blank?
|
8
11
|
a.insert-image href="" Clique para inserir imagem
|
9
12
|
.actions-container style="display:none;"
|