cfinke / Feed-Sidebar

The Feed Sidebar is an extension for Firefox that displays the items from your Live Bookmarks in the sidebar.
https://addons.mozilla.org/en-US/firefox/addon/4869/
GNU General Public License v2.0
5 stars 3 forks source link

Bugfix: Marked as read feeds are not coloured in grey #85

Open michaeldietz opened 11 years ago

michaeldietz commented 11 years ago

Using Firefox 22 if you mark a feed as read then its colour doesn't change to grey like in previous versions.

This is the case because with Geko 22 the function getCellProperties has to return a string containing the property and not an array of atom objects anymore (source).

To fix this issue replace the getCellProperties function in treeview.js with the following code:

getCellProperties: function (row, col, props) {
    if (!FEEDBAR.isContainer(row)) {
        if (FEEDBAR.getCellRead(row)) { 
            if (props) {
                var atomService = Components.classes["@mozilla.org/atom-service;1"].
                    getService(Components.interfaces.nsIAtomService);
                props.AppendElement(atomService.getAtom("visited"));
            }
            else {
                return "visited";
            }
        }
    }
    else {
        if (!FEEDBAR.hasUnreadItems(row)) {
            if (props) {
                var atomService = Components.classes["@mozilla.org/atom-service;1"].
                    getService(Components.interfaces.nsIAtomService);
                props.AppendElement(atomService.getAtom("visited"));
            }
            else {
                return "visited";
            }
        }
    }
}