avatars_for_rails 1.0.6 → 1.0.7

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: df4a19bc0840c78f2e18f9505c209acba612a5b2
4
- data.tar.gz: eb3a1d051f164871182ae10478fea1b65ca94e87
3
+ metadata.gz: 56695592a126d6233ce5a370c461e54ca47539f2
4
+ data.tar.gz: 61b2f45b13cd21063ebfec2ac1f67060e3f5c4ca
5
5
  SHA512:
6
- metadata.gz: a001bd658dfa111f4e743d0a3c953630b60ba92ae80880d5ed0014173f4fc545d1f0d89901a11a647000fcb1f5f1ce627461a3248682e6a1f2889f2ade544896
7
- data.tar.gz: 86b5c9e50a24193a26e90ecd02ca3090a071aa6c6ebe039d7686c9487330037001295ea065231373e385452ff304ae199303e86bfbdb79d08913f83c204681e5
6
+ metadata.gz: 725ff159ff4bbd5f8d41d3df1380df405e37a7841494baed4ee4a86c00752973a165c0ded315574975b2afeb259f37698dde4fbedf12519e5d058eb3df915a72
7
+ data.tar.gz: b7b14122ff2b503902b9f11568d99aef8476c8e342ee64f2af02cc3d0d8519fabb50ba4c10f0c254dd53c6bd1381ce5843fba988e56158f8724a3d7960db437a
data/Rakefile CHANGED
@@ -17,5 +17,3 @@ Rake::RDocTask.new(:rdoc) do |rdoc|
17
17
  rdoc.rdoc_files.include('README.rdoc')
18
18
  rdoc.rdoc_files.include('lib/**/*.rb', 'app/**/*.rb')
19
19
  end
20
-
21
- Bundler::GemHelper.install_tasks
@@ -46,13 +46,14 @@ var AvatarForRails = AvatarForRails || (function($, undefined) {
46
46
  };
47
47
 
48
48
  var initCrop = function(data) {
49
- var div = $('section.avatar .update'),
49
+ var div = $('.avatar-update'),
50
50
  img,
51
51
  ar;
52
52
 
53
+ $('#avatar-progress .bar').css('width', '0%');
53
54
  div.html(data);
54
55
 
55
- img = div.find('img.crop'),
56
+ img = div.find('img.avatar-crop'),
56
57
  ar = parseInt(img.attr('data-aspect_ratio'), 10);
57
58
 
58
59
  img.Jcrop({
@@ -66,7 +67,7 @@ var AvatarForRails = AvatarForRails || (function($, undefined) {
66
67
  };
67
68
 
68
69
  var updateCrop = function(coords) {
69
- var img = $('section.avatar img.crop');
70
+ var img = $('img.avatar-crop');
70
71
  var iW = img.width();
71
72
  var iH = img.height();
72
73
 
@@ -1,4 +1,4 @@
1
- <%= image_tag avatarable.avatar_tmp_public_path(root_path), class: 'crop', "data-aspect_ratio" => avatarable.class.logo_aspect_ratio %>
1
+ <%= image_tag avatarable.avatar_tmp_public_path(root_path), class: 'avatar-crop', "data-aspect_ratio" => avatarable.class.logo_aspect_ratio %>
2
2
 
3
3
  <%= form_for avatarable, url: avatar_path, multipart: true do |f| %>
4
4
  <% %w( x y w ).each do |attr| %>
@@ -1,6 +1,8 @@
1
- <%= form_for avatarable, url: avatar_path, multipart: true do |f| %>
2
- <%= f.file_field :logo, "data-url" => avatar_path %>
3
- <% end %>
1
+ <div class="avatar-update">
2
+ <%= form_for avatarable, url: avatar_path, multipart: true do |f| %>
3
+ <%= f.file_field :logo, "data-url" => avatar_path %>
4
+ <% end %>
5
+ </div>
4
6
 
5
7
  <%= render partial: 'avatars/progress' %>
6
8
 
@@ -56,7 +56,7 @@ module AvatarsForRails
56
56
  end
57
57
 
58
58
  def crop_avatar
59
- return unless avatar_tmp_file?
59
+ return unless logo_crop_x && avatar_tmp_file?
60
60
 
61
61
  width, height = avatar_tmp_file_dimensions
62
62
 
@@ -1,3 +1,3 @@
1
1
  module AvatarsForRails
2
- VERSION = "1.0.6"
2
+ VERSION = "1.0.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: avatars_for_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jaime Castro Montero
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-16 00:00:00.000000000 Z
12
+ date: 2013-05-17 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jquery-rails