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: ef4b00fc7c12fd5758825de3ff62ad637c43fe64
4
- data.tar.gz: e048baca027d44c08a2ef1efc31580f2b1e8facd
3
+ metadata.gz: 9647f21d4d31d4a44457de3e0d5a4a1ef601f6ef
4
+ data.tar.gz: 8a8a9d678daec6343e3d26d068bd63e19fc9210d
5
5
  SHA512:
6
- metadata.gz: bc412e20baabc0f954552007be03e071bb09fb1634dcdfeaffdb15fb1a66de7950e1d3ec41abdea58b8014c18d2bffc1bbd69cfb8b933d1b8d837990a888b1ec
7
- data.tar.gz: 728a84f25760397fa8e8cb12808826d49831d70ea66f4775398770dafed3aa7de0e5e589f4bf15de005a644ff9e16f9b283ce6bfc80cea3aff988e508a5f30c1
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, title = "", css_class="")
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[:title] = title
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
- img.preview.editable-preview src="#{image_src}" alt="#{local_assigns[:title]}" class="#{local_assigns[:class]}"
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;"
@@ -1 +1,3 @@
1
- img alt="imagem" src="#{image_src}" alt="#{local_assigns[:title]}" class="#{local_assigns[:class]}" /
1
+ = content_tag :img do |el|
2
+ - attrs.each {|key_name, value| el[key_name.to_sym] = value }
3
+ - el[:src] = image_src
@@ -1,3 +1,3 @@
1
1
  module InplaceEditing
2
- VERSION = "0.3.12"
2
+ VERSION = "0.3.13"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inplace_editing
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.12
4
+ version: 0.3.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Henrique Rangel