Move new post button handler to DiscussionRouter.
This commit is contained in:
@@ -14,6 +14,9 @@ if Backbone?
|
||||
|
||||
@newPostView = new NewPostView(el: $(".new-post-article"), collection: @discussion)
|
||||
@nav.on "thread:created", @navigateToThread
|
||||
@newPost = $('.new-post-article')
|
||||
$('.new-post-btn').bind "click", @showNewPost
|
||||
$('.new-post-cancel').bind "click", @hideNewPost
|
||||
|
||||
allThreads: ->
|
||||
@nav.updateSidebar()
|
||||
@@ -43,3 +46,10 @@ if Backbone?
|
||||
|
||||
navigateToAllThreads: =>
|
||||
@navigate("", trigger: true)
|
||||
|
||||
showNewPost: (event) =>
|
||||
@newPost.slideDown(300)
|
||||
$('.new-post-title').focus()
|
||||
|
||||
hideNewPost: (event) =>
|
||||
@newPost.slideUp(300)
|
||||
|
||||
@@ -55,8 +55,6 @@ $(document).ready(function() {
|
||||
// $topicDrop.bind('click', setTopic);
|
||||
$formTopicDropBtn.bind('click', showFormTopicDrop);
|
||||
$formTopicDropMenu.bind('click', setFormTopic);
|
||||
$('.new-post-btn').bind('click', newPost);
|
||||
$('.new-post-cancel').bind('click', closeNewPost);
|
||||
|
||||
$body.delegate('[data-tooltip]', {
|
||||
'mouseover': showTooltip,
|
||||
@@ -266,15 +264,6 @@ function setTopic(e) {
|
||||
showBrowse();
|
||||
}
|
||||
|
||||
function newPost(e) {
|
||||
$newPost.slideDown(300);
|
||||
$('.new-post-title').focus();
|
||||
}
|
||||
|
||||
function closeNewPost(e) {
|
||||
$newPost.slideUp(300);
|
||||
}
|
||||
|
||||
function showFormTopicDrop(e) {
|
||||
$formTopicDropBtn.addClass('is-dropped');
|
||||
$formTopicDropMenu.show();
|
||||
|
||||
Reference in New Issue
Block a user