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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc6e1897a22ad026f5a537d0bd64744c9d1c1fc3
|
4
|
+
data.tar.gz: c22328163bb2cd315a3117d0679f8930cafb9e0e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|