Skip to content

Instantly share code, notes, and snippets.

@ianjosephwilson
Created November 27, 2012 21:37
Show Gist options
  • Save ianjosephwilson/4157248 to your computer and use it in GitHub Desktop.
Save ianjosephwilson/4157248 to your computer and use it in GitHub Desktop.
var Feed = {
highlightStory: function () {
var uri, urlQuery, storyId, queryObject, storyGroupEl;
uri = window.location.search.toString();
urlQuery = uri.substring(uri.indexOf("?") + 1, uri.length);
queryObject = ioQuery.queryToObject(urlQuery);
if (queryObject.story_id) {
storyId = queryObject.story_id;
window.location.hash = storyId;
} else {
storyId = window.location.hash.slice(1);
}
if (!storyId.length) {
return;
}
storyGroupEl = query('#' + storyId).parents('.story_group')[0];
// @TODO: This is terrible, we should just factor out the edit
// comment guts.
if (queryObject.comment && queryObject.comment === 'True') {
// Fire edit comment with a fake event.
this.editComment({
target: query('.new_comment_link', storyGroupEl)[0],
preventDefault: function () {}
});
}
// @TODO: Need to port fx.
domStyle.set(storyGroupEl, 'background-color', '#e4eff7');
},
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment