From 693627d3c98bb883de08f89f02ec94c4388d50da Mon Sep 17 00:00:00 2001 From: albert Date: Sun, 17 Feb 2013 22:21:05 -0500 Subject: [PATCH] fix layout js --- app/assets/javascripts/layout.js | 25 +++++++++++-------- .../stylesheets/common/main_layout.css.scss | 2 +- app/views/wiki_pages/index.html.erb | 2 +- .../paginator/active_record_extension.rb | 2 -- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/app/assets/javascripts/layout.js b/app/assets/javascripts/layout.js index d6522fb1a..2bafd2708 100644 --- a/app/assets/javascripts/layout.js +++ b/app/assets/javascripts/layout.js @@ -2,24 +2,27 @@ Danbooru.Layout = {}; Danbooru.Layout.initialize = function() { - $(window).resize(Danbooru.Layout.restyle_content); + if ($("#c-posts").length && $("#a-index").length) { + $(window).resize(Danbooru.Layout.restyle_content); + Danbooru.Layout.restyle_content(); + } } Danbooru.Layout.restyle_content = function() { if ($(window).width() > 1100) { - $("#content").css("max-width", "50em"); - } - + $("#content").css("width", "50em"); + } + if ($(window).width() > 1300) { - $("#content").css("max-width", "60em"); - } - + $("#content").css("width", "60em"); + } + if ($(window).width() > 1500) { - $("#content").css("max-width", "70em"); - } - + $("#content").css("width", "70em"); + } + if ($(window).width() < 1000) { - $("#content").css("max-width", "40em"); + $("#content").css("width", "40em"); } } })(); diff --git a/app/assets/stylesheets/common/main_layout.css.scss b/app/assets/stylesheets/common/main_layout.css.scss index 1af95a08b..8df49fe4a 100644 --- a/app/assets/stylesheets/common/main_layout.css.scss +++ b/app/assets/stylesheets/common/main_layout.css.scss @@ -46,7 +46,7 @@ div#page { } section#content { - max-width: 50em; + width: 70%; float: left; padding-left: 2em; overflow: visible; diff --git a/app/views/wiki_pages/index.html.erb b/app/views/wiki_pages/index.html.erb index 83a531474..d8e343da1 100644 --- a/app/views/wiki_pages/index.html.erb +++ b/app/views/wiki_pages/index.html.erb @@ -16,7 +16,7 @@ <% @wiki_pages.each do |wiki_page| %> <%= link_to wiki_page.pretty_title, wiki_page_path(wiki_page, :noredirect => 1) %> - <%= wiki_page.updated_at.strftime("%m/%d/%Y %I:%M") %> by <%= h wiki_page.creator.name %> + <%= wiki_page.updated_at.strftime("%m/%d/%Y %I:%M") %> by <%= h link_to wiki_page.creator.name, user_path(wiki_page.creator) %> <% end %> diff --git a/lib/danbooru/paginator/active_record_extension.rb b/lib/danbooru/paginator/active_record_extension.rb index c987478cf..c00f59f5e 100644 --- a/lib/danbooru/paginator/active_record_extension.rb +++ b/lib/danbooru/paginator/active_record_extension.rb @@ -9,8 +9,6 @@ module Danbooru def paginate(page, options = {}) @paginator_options = options - # connection.execute("SET statement_timeout=500") - if use_sequential_paginator?(page) paginate_sequential(page) else