Add an "ask a question" link to item descriptions

This commit is contained in:
Andrew Miner
2015-06-12 14:28:45 -07:00
parent 6f65defc0a
commit b139d94d4d
3 changed files with 21 additions and 0 deletions
@@ -88,6 +88,10 @@ module.exports = class MarkdownSectionController extends BaseController
@state = State.appologizing
w(true).delay(@confirmDuration).then => @resetToDefaultState()
onQuestionClicked: (event)->
event.preventDefault()
global.feedbackController.enterFeedback ''
onPreviewClicked: (event)->
event.preventDefault()
@_updatePreview()
@@ -162,6 +166,9 @@ module.exports = class MarkdownSectionController extends BaseController
@on Event.change + ':imageBase', => @_imageListController.model.imageBase = @imageBase
@listenTo @_imageListController, Event.change + ':valid', => @tryRefresh()
if not global.feedbackController?
@$('.question').hide duration:0
@$errorText = @$('.error p')
@$markdownPanel = @$('.markdown')
@$previewButton = @$('button.preview')
@@ -200,6 +207,7 @@ module.exports = class MarkdownSectionController extends BaseController
'click button.preview': 'onPreviewClicked'
'click button.return': 'onReturnClicked'
'click button.save': 'onSaveClicked'
'click .question a': 'onQuestionClicked'
'input textarea': 'onTextChanged'
# Private Methods ##############################################################################