mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-01-27 15:58:06 -05:00
add liked/disliked style to midcol to fix score updates
This commit is contained in:
@@ -216,7 +216,7 @@ $.fn.vote = function(vh, callback) {
|
||||
/* let the user vote only if they are logged in */
|
||||
if(reddit.logged) {
|
||||
things.each(function() {
|
||||
var entry = $(this).find(".entry:first");
|
||||
var entry = $(this).find(".entry:first, .midcol:first");
|
||||
if(dir > 0)
|
||||
entry.addClass('likes').removeClass('dislikes');
|
||||
else if(dir < 0)
|
||||
|
||||
@@ -525,7 +525,7 @@ function updateEventHandlers(thing) {
|
||||
.filter(":visible").trigger("onshow");
|
||||
|
||||
/* click on a title.. */
|
||||
$(thing).find("a.title").mousedown(function() {
|
||||
$(thing).find("a.title, a.comments").mousedown(function() {
|
||||
/* the site is either stored in the sr dict, or we are on
|
||||
* an sr and it is the current one */
|
||||
var sr = reddit.sr[$(this).thing_id()] || reddit.cur_site;
|
||||
|
||||
@@ -30,8 +30,8 @@
|
||||
### specific fill-in functions for comment
|
||||
##################
|
||||
|
||||
<%def name="midcol(display=True)">
|
||||
${parent.midcol(not thing.collapsed)}
|
||||
<%def name="midcol(display=True, cls = '')">
|
||||
${parent.midcol(not thing.collapsed, cls = cls)}
|
||||
</%def>
|
||||
|
||||
<%def name="ParentDiv()">
|
||||
|
||||
@@ -23,9 +23,9 @@
|
||||
<%inherit file="printable.html"/>
|
||||
<%namespace file="utils.html" import="plain_link" />
|
||||
|
||||
<%def name="midcol(display=True)">
|
||||
<%def name="midcol(display=True, cls = '')">
|
||||
%if c.profilepage or (not thing._deleted and (not thing._spam or c.user == thing.author or c.user_is_admin)):
|
||||
${parent.midcol(display=display)}
|
||||
${parent.midcol(display=display, cls = cls)}
|
||||
%endif
|
||||
</%def>
|
||||
|
||||
|
||||
@@ -83,8 +83,8 @@
|
||||
</script>
|
||||
</%def>
|
||||
|
||||
<%def name="midcol(display=True)">
|
||||
<div class="midcol" style="width:$midcolmargin;"
|
||||
<%def name="midcol(display=True, cls = '')">
|
||||
<div class="midcol ${cls}" style="width:$midcolmargin;"
|
||||
${not display and "style='display:none'" or ''}>
|
||||
${self.arrow(thing, 1, thing.likes)}
|
||||
%if thing.hide_score:
|
||||
|
||||
@@ -35,8 +35,8 @@
|
||||
</span>
|
||||
</%def>
|
||||
|
||||
<%def name="midcol(display=True)">
|
||||
<div class="midcol" style="width:&midcolmargin;"
|
||||
<%def name="midcol(display=True, cls = '')">
|
||||
<div class="midcol ${cls}" style="width:&midcolmargin;"
|
||||
${not display and "style='display:none'" or ''}>
|
||||
${self.arrow(thing, 1, thing.likes)}
|
||||
${self.arrow(thing, 0, thing.likes == False)}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<%inherit file="comment_skeleton.html"/>
|
||||
|
||||
## disable voting arrows
|
||||
<%def name="midcol()">
|
||||
<%def name="midcol(cls='')">
|
||||
</%def>
|
||||
|
||||
|
||||
|
||||
@@ -50,6 +50,6 @@ load more comments <span class="gray"> (${thing.count} ${ungettext("reply",
|
||||
<%def name="tagline(collapse=False)">
|
||||
</%def>
|
||||
|
||||
<%def name="midcol()">
|
||||
<%def name="midcol(cls = '')">
|
||||
</%def>
|
||||
|
||||
|
||||
@@ -41,6 +41,6 @@
|
||||
<%def name="tagline(collapse=False)">
|
||||
</%def>
|
||||
|
||||
<%def name="midcol()">
|
||||
<%def name="midcol(cls='')">
|
||||
</%def>
|
||||
|
||||
|
||||
@@ -77,7 +77,6 @@ thing id-${what._fullname}
|
||||
${self.ParentDiv()}
|
||||
</p>
|
||||
${self.numcol()}
|
||||
${self.midcol()}
|
||||
<%
|
||||
like_cls = "unvoted"
|
||||
if getattr(thing, "likes", None):
|
||||
@@ -85,6 +84,7 @@ thing id-${what._fullname}
|
||||
elif getattr(thing, "likes", None) is False:
|
||||
like_cls = "dislikes"
|
||||
%>
|
||||
${self.midcol(cls = like_cls)}
|
||||
<div class="entry ${like_cls}">
|
||||
${self.entry()}
|
||||
</div>
|
||||
@@ -218,8 +218,8 @@ thing id-${what._fullname}
|
||||
</%def>
|
||||
|
||||
|
||||
<%def name="midcol(display=True)">
|
||||
<div class="midcol"
|
||||
<%def name="midcol(display=True, cls = '')">
|
||||
<div class="midcol ${cls}"
|
||||
${not display and "style='display:none'" or ''}>
|
||||
${self.arrow(thing, 1, thing.likes)}
|
||||
${self.arrow(thing, 0, thing.likes == False)}
|
||||
|
||||
@@ -98,7 +98,7 @@
|
||||
|
||||
</%def>
|
||||
|
||||
<%def name="midcol(display=True)">
|
||||
<%def name="midcol(display=True, cls='')">
|
||||
<div class="midcol">
|
||||
${addremove_button(thing)}
|
||||
${permission_icons(thing)}
|
||||
|
||||
Reference in New Issue
Block a user