What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

When you go to profile -> favorites for the first time (or on a full page reload), the de/re-select works as expected. However, after clicking to change the sort or if you go to another page of Favorites it no longer appears to register the click.

I've checked in Fx 3.5.x and Chrome 3.0.x(beta)

share|improve this question
2  
Broken on my machine too. –  jjnguy Aug 19 '09 at 18:44
    
Confirmed for me too with IE 8 and FF 3.5.x. It's making favorites management quite a chore. –  Daniel Auger Oct 17 '09 at 19:28
    
Still broken in the year 2010. –  Zombies May 24 '10 at 20:07

2 Answers 2

up vote 3 down vote accepted

Using some suggestions from Nick Craver, this has been fixed.

share|improve this answer

Here's the script I use to fix the in-page version SO currently outputs, replacing the SO version with this would resolve the favorites issue, (it can be optimized much further, trying to change as little as possible for the purposes of a fix patch):

$(function() {
    $(".star-off")
        .css("cursor", "pointer")
        .attr("title", "This is a favorite question (click again to undo)");
    $(".star-off:not(.disabled)").live('click', function() {
        voteFavorite($(this));
    });
});

function getPostId(jClicked) {
    return jClicked.prev("input").val();
}

function voteFavorite(jClicked) {
    var jFavoriteCount = jClicked.parent().find("b");
    var count = parseInt("0" + jFavoriteCount.text().replace(/^\s+|\s+$/g, ""), 10);

    if (jClicked.hasClass('star-on')) {
        jFavoriteCount.css("color", "#808185").text((count-- <= 0) ? "" : count);
    } else {
        jFavoriteCount.css("color", "#D4A849").text(++count);   
    }

    jClicked.addClass('disabled').toggleClass('star-on');

    submit(jClicked, getPostId(jClicked), 5, function() {
        jClicked.removeClass('disabled');
    });     
}

function submit(jClicked, postId, voteTypeId, callback) {
    var formData = { "fkey": "FORMDATAKEYHERE" };

    $.post("/posts/" + postId + "/vote/" + voteTypeId, formData, function(data) { callback(jClicked, postId, data); }, "json");
};
share|improve this answer
    
nice and neat. very cool. –  Rob Allen Jun 10 '10 at 2:03

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .