Make forum New Post buttons behave as buttons
JIRA: FOR-205
This commit is contained in:
@@ -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()
|
||||
|
||||
@@ -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: ->
|
||||
|
||||
@@ -4,6 +4,6 @@
|
||||
|
||||
<%block name="extratabs">
|
||||
% if has_permission(user, 'create_thread', course.id):
|
||||
<li class="right"><a href="#" class="new-post-btn"><span class="icon icon-edit new-post-icon"></span>${_("New Post")}</a></li>
|
||||
<li class="right"><a href="#" class="new-post-btn" role="button"><span class="icon icon-edit new-post-icon"></span>${_("New Post")}</a></li>
|
||||
% endif
|
||||
</%block>
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
|
||||
<div class="discussion-module" data-discussion-id="${discussion_id | h}">
|
||||
<a class="discussion-show control-button" href="javascript:void(0)" data-discussion-id="${discussion_id | h}" role="button"><span class="show-hide-discussion-icon"></span><span class="button-text">${_("Show Discussion")}</span></a>
|
||||
<a href="#" class="new-post-btn"><span class="icon icon-edit new-post-icon"></span>${_("New Post")}</a>
|
||||
<a href="#" class="new-post-btn" role="button"><span class="icon icon-edit new-post-icon"></span>${_("New Post")}</a>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user