Commit f6ee6f2a by Arjun Singh

working on newpost

parent e3728f68
......@@ -10,6 +10,8 @@ class @DiscussionRouter extends Backbone.Router
@nav.on "threads:rendered", @setActiveThread
@nav.render()
@newPostView = new NewPostView(el: $(".new-post-article"))
allThreads: ->
true
......
class @NewPostView extends Backbone.View
initialize: () ->
@dropdownButton = @$(".topic_dropdown_button")
#events:
# "submit .new-post-form": "createPost"
# "click .topic_dropdown_button": "toggleTopicDropdown"
# "click .topic_menu": "setTopic"
#toggleTopicDropdown: (event) ->
# if $target.hasClass('dropped')
# @showTopicDropdown()
# else
# @hideTopicDropdown()
#
#showTopicDropdown: () ->
# #$button =
# $button.addClass('dropped')
# $topicMenu = @$(".topic_menu")
# $topicMenu.show()
#createPost: (event) ->
# event.preventDefault()
# title = @$(".new-post-title").val()
# body = @$(".new-post-body").val()
# tags = @$(".new-post-tags").val()
# anonymous = false || @$("input.discussion-anonymous").is(":checked")
# follow = false || @$("input.discussion-follow").is(":checked")
# $formTopicDropBtn.bind('click', showFormTopicDrop);
# $formTopicDropMenu.bind('click', setFormTopic);
# url = DiscussionUtil.urlFor('create_thread', @model.id)
# DiscussionUtil.safeAjax
# $elem: $(event.target)
# $loading: $(event.target) if event
# url: url
# type: "POST"
# dataType: 'json'
# data:
# title: title
# body: body
# tags: tags
# anonymous: anonymous
# auto_subscribe: follow
# error: DiscussionUtil.formErrorHandler(@$(".new-post-form-errors"))
# success: (response, textStatus) =>
# DiscussionUtil.clearFormErrors(@$(".new-post-form-errors"))
# $thread = $(response.html)
# @$el.children(".threads").prepend($thread)
# @$el.children(".blank").remove()
# @$(".new-post-similar-posts").empty()
# @$(".new-post-similar-posts-wrapper").hide()
# @$(".new-post-title").val("").attr("prev-text", "")
# DiscussionUtil.setWmdContent @$el, $.proxy(@$, @), "new-post-body", ""
# @$(".new-post-tags").val("")
# @$(".new-post-tags").importTags("")
# thread = @model.addThread response.content
# threadView = new ThreadView el: $thread[0], model: thread
# thread.updateInfo response.annotated_content_info
# @cancelNewPost()
......@@ -429,7 +429,7 @@ body.discussion {
opacity: 0;
}
&.is-dropped {
&.dropped {
.browse-topic-drop-btn {
span {
......@@ -442,13 +442,13 @@ body.discussion {
}
}
&.is-dropped {
&.dropped {
.browse-topic-drop-btn {
background-color: #616161;
}
}
&.is-dropped {
&.dropped {
.browse-topic-drop-icon {
background-position: 0 -16px;
}
......
......@@ -38,9 +38,9 @@
</div>
</div>
<div class="options">
<input type="checkbox" name="follow" id="new-post-follow" checked><label for="new-post-follow">follow this post</label>
<input type="checkbox" name="follow" class="discussion-anonymous" class="discussion-follow" id="new-post-follow" checked><label for="new-post-follow">follow this post</label>
<br>
<input type="checkbox" name="follow" id="new-post-anonymous" checked><label for="new-post-anonymous">post anonymously</label>
<input type="checkbox" name="follow" class="discussion-follow" id="new-post-anonymous" checked><label for="new-post-anonymous">post anonymously</label>
</div>
</div>
<div class="right-column">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment