ack_rails_admin_jcrop 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6be68f7add71d4fa568ceaade4035e7422e705a
4
- data.tar.gz: fa922ff3e42d6bf637ab383c7520b483745b398a
3
+ metadata.gz: bc6e1897a22ad026f5a537d0bd64744c9d1c1fc3
4
+ data.tar.gz: c22328163bb2cd315a3117d0679f8930cafb9e0e
5
5
  SHA512:
6
- metadata.gz: 88b8d78a2f9271f0d28c40f9a6d59dd155ef770cb7438de716b74f6e98abb7e30ea7b864596a529c16e892b1b04ff86e06093271fea367fe59e4e4c2d1a63402
7
- data.tar.gz: 95a535e8ecd264493415a8b5eefb41b67a1e28319232c71d3915a049cc5beedd59507ca644c1ecc6b900826e7bf81eea3d282b670ab8d7bf277006b5f70cec48
6
+ metadata.gz: 22b2b92358bbdddbe506617af53aed5c72dca05f0e42ad919ac03c0213d19a70a67f9468aae82fa6bad722b294bd5788a309c777d13e3459fe9b6520651f4056
7
+ data.tar.gz: a1e007f3743a98d5bcc7c0967fd439d8e6788b715e73c551f379fe6aae8bbb91c62e01a438cb6c0adbaec6c0aaf999bf7c41f9244d125a5a330f6257da5d2588
@@ -103,7 +103,7 @@
103
103
  var json = $.parseJSON(data.responseText);
104
104
  var select = widget.element.find('select').filter(":hidden");
105
105
 
106
- thumb = widget.element.find('a.jcrop_handle').data('thumb');
106
+ thumb = widget.element.find('a.jcrop_handle').data('thumb') || "original";
107
107
  widget.element.find('.jcrop_data_value img').removeAttr('src').attr('src', json.urls[thumb] + '?' + new Date().valueOf());
108
108
 
109
109
  widget._trigger("success");
@@ -24,7 +24,7 @@
24
24
  = form.file_field(field.name, field.html_attributes.reverse_merge({data: {fileupload: true, rails_admin_jcrop_options: rails_admin_jcrop_options } }))
25
25
 
26
26
  - url = jcrop_path(model_name: form.object.class.to_param, modal: true, id: form.object.id, field: field.name, fit_image: field.fit_image)
27
- - link_data = {link: url, thumb: field.thumb_method}
27
+ - link_data = {link: url, thumb: field.thumb_method || "original"}
28
28
  = link_to 'Edit Image', '#', data: link_data, style: 'display:none', class: "jcrop_handle"
29
29
 
30
30
  - if field.optional? and field.errors.blank? and file and field.delete_method
@@ -46,7 +46,7 @@ module RailsAdmin
46
46
  end
47
47
 
48
48
  base.register_instance_option(:thumb_method) do
49
- @thumb_method ||= ((versions = bindings[:object].send(name).versions.keys).find{|k| k.in?([:thumb, :thumbnail, 'thumb', 'thumbnail'])} || versions.first.to_s)
49
+ @thumb_method ||= ((versions = bindings[:object].send(name).versions.keys).find{|k| k.in?([:thumb, :thumbnail, 'thumb', 'thumbnail'])} || (versions.first || "original").to_s)
50
50
  end
51
51
 
52
52
  base.register_instance_option(:delete_method) do
@@ -1,3 +1,3 @@
1
1
  module RailsAdminJcrop
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ack_rails_admin_jcrop
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - ack43