Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ if Backbone?
"click .home": "goHome"
"click .browse": "toggleTopicDrop"
"keydown .post-search-field": "performSearch"
"focus .post-search-field": "showSearch"
"click .sort-bar a": "sortThreads"
"click .browse-topic-drop-menu": "filterTopic"
"click .browse-topic-drop-search-input": "ignoreClick"
Expand Down Expand Up @@ -209,7 +210,7 @@ if Backbone?

@$(".search").addClass('is-open')
@$(".browse").removeClass('is-open')
setTimeout (-> @$(".post-search-field").focus()), 200
setTimeout (-> @$(".post-search-field").focus()), 200 unless @$(".post-search-field").is(":focus")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we even have a timeout here to begin with?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dates to a commit made in late 2012. my guess is that it smooths transitions, perhaps on sluggish browsers? I tried without the timeout and it doesn't seem to make a difference but my system is fairly zippy.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough


goHome: ->
@template = _.template($("#discussion-home").html())
Expand Down