mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-28 00:07:57 -05:00
space compression in buttons to fix safari bug. Improved console debugging in JS.
This commit is contained in:
@@ -28,6 +28,7 @@ from r2.lib.utils import tup
|
||||
from pylons import c, request
|
||||
from validator import *
|
||||
from pylons.i18n import _
|
||||
from r2.lib.filters import spaceCompress
|
||||
|
||||
class ButtonsController(RedditController):
|
||||
def buttontype(self):
|
||||
@@ -102,11 +103,12 @@ class ButtonsController(RedditController):
|
||||
else:
|
||||
target = "_parent"
|
||||
|
||||
c.response.content = page_handler(button=bt, css=css,
|
||||
score_fmt = score_fmt, link = l,
|
||||
url=url, title=title,
|
||||
vote = vote, target = target,
|
||||
bgcolor=c.bgcolor, width=width).render()
|
||||
res = page_handler(button=bt, css=css,
|
||||
score_fmt = score_fmt, link = l,
|
||||
url=url, title=title,
|
||||
vote = vote, target = target,
|
||||
bgcolor=c.bgcolor, width=width).render()
|
||||
c.response.content = spaceCompress(res)
|
||||
return c.response
|
||||
|
||||
|
||||
|
||||
@@ -10,8 +10,12 @@
|
||||
/* utility functions */
|
||||
|
||||
$.log = function(message) {
|
||||
if (window.console)
|
||||
console.debug(message);
|
||||
if (window.console) {
|
||||
if (window.console.debug)
|
||||
window.console.debug(message);
|
||||
else if (window.console.log)
|
||||
window.console.log(message);
|
||||
}
|
||||
else
|
||||
alert(message);
|
||||
};
|
||||
@@ -169,7 +173,7 @@ $.fn.vote = function(vh, callback) {
|
||||
var things = $(this).all_things_by_id();
|
||||
/* find all arrows of things on the page */
|
||||
var arrows = things.children().not(".child").find('.arrow');
|
||||
|
||||
|
||||
/* set the new arrow states */
|
||||
var u_before = (dir == 1) ? up_cls : upmod_cls;
|
||||
var u_after = (dir == 1) ? upmod_cls : up_cls;
|
||||
|
||||
Reference in New Issue
Block a user