Make forum New Post buttons behave as buttons

JIRA: FOR-205
This commit is contained in:
Greg Price
2014-01-17 15:12:55 -05:00
parent 2014d34c8a
commit 60fb3cfbb2
4 changed files with 6 additions and 3 deletions

View File

@@ -5,6 +5,8 @@ if Backbone?
"keydown .discussion-show":
(event) -> DiscussionUtil.activateOnSpace(event, @toggleDiscussion)
"click .new-post-btn": "toggleNewPost"
"keydown .new-post-btn":
(event) -> DiscussionUtil.activateOnSpace(event, @toggleNewPost)
"click .new-post-cancel": "hideNewPost"
"click .discussion-paginator a": "navigateToPage"
@@ -19,7 +21,7 @@ if Backbone?
else
@page = 1
toggleNewPost: (event) ->
toggleNewPost: (event) =>
event.preventDefault()
if !@newPostForm
@toggleDiscussion()

View File

@@ -16,6 +16,7 @@ if Backbone?
@nav.on "thread:created", @navigateToThread
@newPost = $('.new-post-article')
$('.new-post-btn').bind "click", @showNewPost
$('.new-post-btn').bind "keydown", (event) => DiscussionUtil.activateOnSpace(event, @showNewPost)
$('.new-post-cancel').bind "click", @hideNewPost
allThreads: ->