mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 07:48:16 -05:00
IE6 fix for disappearing content on voting. Also JS patch to remove unvoted class on vote.
This commit is contained in:
@@ -1,5 +1,24 @@
|
||||
.link { line-height: 1.1; }
|
||||
|
||||
/* I don't even pretend to understand why we need this when we set
|
||||
* .score.likes, .score.dislikes { display: none }
|
||||
* in the main css. Those act to hide the *entire* thing in IE6, but is fixed
|
||||
* by only changing the midcol css. */
|
||||
.thing .midcol.likes, .thing .midcol.dislikes { display: block; }
|
||||
|
||||
.thing .midcol .score { display: none; }
|
||||
|
||||
.thing .midcol.unvoted .score.unvoted { display: block; }
|
||||
.thing .midcol.likes .score.likes { display: block; }
|
||||
.thing .midcol.dislikes .score.dislikes { display: block; }
|
||||
|
||||
.thing .entry .score { display: none; }
|
||||
|
||||
.thing .entry.unvoted .score.unvoted { display: inline; }
|
||||
.thing .entry.likes .score.likes { display: inline; }
|
||||
.thing .entry.dislikes .score.dislikes { display: inline; }
|
||||
|
||||
|
||||
div.dropdown.tabdrop { display: inline; }
|
||||
|
||||
div.drop-choices {
|
||||
|
||||
@@ -218,11 +218,14 @@ $.fn.vote = function(vh, callback) {
|
||||
things.each(function() {
|
||||
var entry = $(this).find(".entry:first, .midcol:first");
|
||||
if(dir > 0)
|
||||
entry.addClass('likes').removeClass('dislikes');
|
||||
entry.addClass('likes')
|
||||
.removeClass('dislikes unvoted');
|
||||
else if(dir < 0)
|
||||
entry.removeClass('likes').addClass('dislikes');
|
||||
entry.addClass('dislikes')
|
||||
.removeClass('likes unvoted');
|
||||
else
|
||||
entry.removeClass('likes').removeClass('dislikes');
|
||||
entry.addClass('unvoted')
|
||||
.removeClass('likes dislikes');
|
||||
});
|
||||
|
||||
$.request("vote", {id: things.filter(":first").thing_id(),
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
thing.score_fmt = Score.safepoints
|
||||
%>
|
||||
${self.arrows(thing)}
|
||||
<div class="reddit-entry"
|
||||
<div class="reddit-entry entry ${thing.like_cls}"
|
||||
%if expanded:
|
||||
${optionalstyle("margin-left: 58px;")}
|
||||
%else:
|
||||
|
||||
@@ -22,6 +22,14 @@
|
||||
<%namespace file="utils.html" import="optionalstyle"/>
|
||||
<%namespace file="printable.html" import="arrow"/>
|
||||
|
||||
<%
|
||||
like_cls = "unvoted"
|
||||
if getattr(thing, "likes", None):
|
||||
like_cls = "likes"
|
||||
elif getattr(thing, "likes", None) is False:
|
||||
like_cls = "dislikes"
|
||||
thing.like_cls = like_cls
|
||||
%>
|
||||
${self.parent()}
|
||||
${self.entry()}
|
||||
${self.Child()}
|
||||
@@ -82,7 +90,7 @@ ${self.Child()}
|
||||
</%def>
|
||||
|
||||
<%def name="real_arrows(thing)">
|
||||
<div class="midcol" ${optionalstyle("width: 15px")}>
|
||||
<div class="midcol ${thing.like_cls}" ${optionalstyle("width: 15px")}>
|
||||
${arrow(thing, 1, thing.likes)}
|
||||
${arrow(thing, 0, thing.likes == False)}
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user