Skip to content
This repository has been archived by the owner on Feb 13, 2019. It is now read-only.

Commit

Permalink
Just a little cleanup on the image URLs
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Sinchok committed Jun 11, 2014
1 parent b243faf commit bb728ed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 1 addition & 2 deletions betty/cropper/templates/image.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
ASPECT_RATIO_TOLERANCE = .1, // 10% tolerance.
breakpoints = [{{ BETTY_WIDTHS|join:","}}];
w.picturefill = function(elements) {
//don't need to do them all at once. can decide to do lazy load if needed
if (elements instanceof Array) {
Expand Down Expand Up @@ -100,7 +99,7 @@
}
id_str += id.charAt(ii);
}
var url = IMAGE_URL + "/" + id_str + "/" + crop + "/" + width + "." + format;
var url = IMAGE_URL + id_str + "/" + crop + "/" + width + "." + format;
imageData.push({
'div': div,
Expand Down
2 changes: 2 additions & 0 deletions betty/cropper/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ def image_js(request):
"BETTY_IMAGE_URL": settings.BETTY_IMAGE_URL,
"BETTY_WIDTHS": sorted(widths)
}
if context["BETTY_IMAGE_URL"].endswith("/"):
context["BETTY_IMAGE_URL"] = context["BETTY_IMAGE_URL"][:-1]
BETTY_RATIOS = []
ratios_sorted = sorted(settings.BETTY_RATIOS, key=lambda r: Ratio(r).width / float(Ratio(r).height))
for ratio_string in ratios_sorted:
Expand Down

0 comments on commit bb728ed

Please sign in to comment.