Skip to content

Commit

Permalink
Use own avatar-* classes
Browse files Browse the repository at this point in the history
  • Loading branch information
atd committed May 17, 2013
1 parent a3597d6 commit 85d436d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
7 changes: 4 additions & 3 deletions app/assets/javascripts/avatars_for_rails.js
Expand Up @@ -46,13 +46,14 @@ var AvatarForRails = AvatarForRails || (function($, undefined) {
};

var initCrop = function(data) {
var div = $('section.avatar .update'),
var div = $('.avatar-update'),
img,
ar;

$('#avatar-progress .bar').css('width', '0%');
div.html(data);

img = div.find('img.crop'),
img = div.find('img.avatar-crop'),
ar = parseInt(img.attr('data-aspect_ratio'), 10);

img.Jcrop({
Expand All @@ -66,7 +67,7 @@ var AvatarForRails = AvatarForRails || (function($, undefined) {
};

var updateCrop = function(coords) {
var img = $('section.avatar img.crop');
var img = $('img.avatar-crop');
var iW = img.width();
var iH = img.height();

Expand Down
2 changes: 1 addition & 1 deletion app/views/avatars/_crop.html.erb
@@ -1,4 +1,4 @@
<%= image_tag avatarable.avatar_tmp_public_path(root_path), class: 'crop', "data-aspect_ratio" => avatarable.class.logo_aspect_ratio %>
<%= image_tag avatarable.avatar_tmp_public_path(root_path), class: 'avatar-crop', "data-aspect_ratio" => avatarable.class.logo_aspect_ratio %>
<%= form_for avatarable, url: avatar_path, multipart: true do |f| %>
<% %w( x y w ).each do |attr| %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/avatars/_form.html.erb
@@ -1,4 +1,4 @@
<div class="update">
<div class="avatar-update">
<%= form_for avatarable, url: avatar_path, multipart: true do |f| %>
<%= f.file_field :logo, "data-url" => avatar_path %>
<% end %>
Expand Down

0 comments on commit 85d436d

Please sign in to comment.