<commit_before>enyo.kind({
    name: "EntryItem",
    kind: "Control",
    classes: "entry-item",
    style: "position: relative;",
    events: {
        onItemSelected: "",
        onItemFavorite: "",
    },
    handlers: {
        ontap: "handleTap"
    },
    components: [
        {
            name: "itemFavorite",
            caption: "",
            classes: "itemFavorite",
            // style: "position: absolute; top: 10px; right: 10px; height: 24px; width: 24px;"
            style: "height: 24px; width: 24px;"
        },
        {
            name: "itemTitle",
            caption: "",
            style: "position: absolute; top: 10px; left: 39px;"
            //fit: true
        },
        {
            name: "itemStatus",
            classes: "itemStatus",
            caption: "",
            style: "position: absolute; top: 10px; right: 39px;"
        },
        {
            name: "itemStatusColor",
            style: "position: absolute; top: 10px; right: 10px; height: 24px; width: 24px;"            
        }
    ],
    // ontap: "handleTap",
    published: {
        title: "",
        data: null,
        favorite: false
    },
    titleChanged: function(inSender, inEvent) {
        this.$.itemTitle.setContent(this.getTitle());
    },
    dataChanged: function(inSender, inEvent) {
        this.$.itemStatus.setContent(this.statusTranslation(this.getData().status).text);
        this.$.itemStatusColor.setClassAttribute(this.statusTranslation(this.getData().status).colorStyle);
    },
    statusTranslation: function(inString) {
        var statuses = {
            "PLANNED WORK": {
                text: "Planned Work",
                colorStyle: "orange-status"
            },
            "GOOD SERVICE": {
                text: "Good Service",
                colorStyle: "green-status"
            },
            "SERVICE CHANGE": {
                text: "Service Change",
                colorStyle: "red-status"
            },
            "DELAYS": {
                text: "Delays",
                colorStyle: "yellow-status"
            }
        };
        
        return statuses[inString];
    },
    favoriteChanged: function(inSender, inEvent) {
        this.$.itemFavorite.addRemoveClass('itemFavoriteSelected', this.getFavorite());
    },
    handleTap: function(inSender, inEvent) {
        var favorite, d;
        if (inSender.name === "itemFavorite") {
            d = this.getData();
            favorite = !d.favorite;
            d.favorite = favorite; 
            this.setFavorite(favorite);
            this.doItemFavorite(d);
        }
        else {
            this.doItemSelected(this.getData());
        }
    }
});<commit_msg>Fixing Favorited Item Select Bug<commit_after>enyo.kind({
    name: "EntryItem",
    kind: "Control",
    classes: "entry-item",
    style: "position: relative;",
    events: {
        onItemSelected: "",
        onItemFavorite: "",
    },
    handlers: {
        ontap: "handleTap"
    },
    components: [
        {
            name: "itemFavorite",
            caption: "",
            classes: "itemFavorite",
            // style: "position: absolute; top: 10px; right: 10px; height: 24px; width: 24px;"
            style: "height: 24px; width: 24px;"
        },
        {
            name: "itemTitle",
            caption: "",
            style: "position: absolute; top: 10px; left: 39px;"
            //fit: true
        },
        {
            name: "itemStatus",
            classes: "itemStatus",
            caption: "",
            style: "position: absolute; top: 10px; right: 39px;"
        },
        {
            name: "itemStatusColor",
            style: "position: absolute; top: 10px; right: 10px; height: 24px; width: 24px;"            
        }
    ],
    // ontap: "handleTap",
    published: {
        title: "",
        data: null,
        favorite: false
    },
    titleChanged: function(inSender, inEvent) {
        this.$.itemTitle.setContent(this.getTitle());
    },
    dataChanged: function(inSender, inEvent) {
        this.$.itemStatus.setContent(this.statusTranslation(this.getData().status).text);
        this.$.itemStatusColor.setClassAttribute(this.statusTranslation(this.getData().status).colorStyle);
    },
    statusTranslation: function(inString) {
        var statuses = {
            "PLANNED WORK": {
                text: "Planned Work",
                colorStyle: "orange-status"
            },
            "GOOD SERVICE": {
                text: "Good Service",
                colorStyle: "green-status"
            },
            "SERVICE CHANGE": {
                text: "Service Change",
                colorStyle: "red-status"
            },
            "DELAYS": {
                text: "Delays",
                colorStyle: "yellow-status"
            }
        };
        
        return statuses[inString];
    },
    favoriteChanged: function(inSender, inEvent) {
        this.$.itemFavorite.addRemoveClass('itemFavoriteSelected', this.getFavorite());
    },
    handleTap: function(inSender, inEvent) {
        var favorite, d;
        d = this.getData();
        d.originator = this;
        if (inSender.name === "itemFavorite") {
            favorite = !d.favorite;
            d.favorite = favorite; 
            this.setFavorite(favorite);
            this.doItemFavorite(d);
        }
        else {
            this.doItemSelected(d);
        }
        delete d.originator;
    }
});
{'fraction_non_alphanumeric': 0.13233137829912023, 'fraction_numerical': 0.010263929618768328, 'mean_word_length': 1.5923990498812353, 'pattern_counts': {'":': 8, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6241916', 'n_tokens_mistral': 1613, 'n_tokens_neox': 1537, 'n_words': 304}