Skip to content

Commit

Permalink
fixed spacing issue for mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
Your Name Here committed Mar 15, 2013
1 parent 60c6922 commit 041c668
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions reddit.js
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ function loadPosts() {
} }
} }
$("#posts").css("display", "block"); $("#posts").css("display", "block");
if ($(window).width > 704) { if ($(window).width() > 704) {
var height = $("li").each(function() { var height = $("li").each(function() {
var height = $(this).outerHeight(); var height = $(this).outerHeight();
$(this).children("span.upvotes").css("height", (height+15)+'px'); $(this).children("span.upvotes").css("height", (height+15)+'px');
Expand All @@ -136,7 +136,7 @@ function loadPosts() {
var height = $("li").each(function() { var height = $("li").each(function() {
var height = $(this).outerHeight(); var height = $(this).outerHeight();
$(this).children("span.upvotes").css("height", (height+15)+'px'); $(this).children("span.upvotes").css("height", (height+15)+'px');
$(this).children("span.upvotes").css("line-height", (height+15)+'px'); $(this).children("span.upvotes").css("line-height", (height+30)+'px');
}); });
} }


Expand All @@ -160,7 +160,7 @@ function frontPage(result) {
} }
} }
$("#posts").css("display", "block"); $("#posts").css("display", "block");
if ($(window).width > 704) { if ($(window).width() > 704) {
var height = $("li").each(function() { var height = $("li").each(function() {
var height = $(this).outerHeight(); var height = $(this).outerHeight();
$(this).children("span.upvotes").css("height", (height+15)+'px'); $(this).children("span.upvotes").css("height", (height+15)+'px');
Expand Down Expand Up @@ -210,10 +210,12 @@ function fixMargins() {
} }


window.onload = function() { window.onload = function() {
if ($(window).width < 704) { if ($(window).width() < 704) {
console.log('here');
$(".image").css("max-width", $(window).width()); $(".image").css("max-width", $(window).width());
$(".image").css("max-width", $(window).height()); $(".image").css("max-width", $(window).height());
$("#apptitle").css("font-size", "16px"); $("#apptitle").css("font-size", "16px");
$("#apptitle").css("margin-top", "26px");
} }
else { else {
$(".image").css("max-width", 500); $(".image").css("max-width", 500);
Expand Down

0 comments on commit 041c668

Please sign in to comment.