Created
November 27, 2012 21:37
-
-
Save ianjosephwilson/4157248 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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