Updated issue form to use new GLForm
This commit is contained in:
parent
5dd01f572c
commit
ff7fb09ea8
4 changed files with 12 additions and 6 deletions
|
@ -35,7 +35,7 @@ class Dispatcher
|
|||
new Diff()
|
||||
when 'projects:issues:new','projects:issues:edit'
|
||||
shortcut_handler = new ShortcutsNavigation()
|
||||
new DropzoneInput($('.issue-form'))
|
||||
new GLForm($('.issue-form'))
|
||||
new IssuableForm($('.issue-form'))
|
||||
when 'projects:merge_requests:new', 'projects:merge_requests:edit'
|
||||
new Diff()
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
class @GLForm
|
||||
constructor: (@form) ->
|
||||
@textarea = @form.find('.js-note-text')
|
||||
@textarea = @form.find('textarea.js-gfm-input')
|
||||
|
||||
# Before we start, we should clean up any previous data for this form
|
||||
@destroy()
|
||||
|
||||
# Setup the form
|
||||
@setupForm()
|
||||
|
||||
@form.data 'gl-form', @
|
||||
|
@ -9,8 +13,10 @@ class @GLForm
|
|||
destroy: ->
|
||||
# Destroy actions
|
||||
actions = @form.data 'form-actions'
|
||||
actions.clearEventListeners()
|
||||
@form.data 'form-actions', null
|
||||
|
||||
if actions?
|
||||
actions.clearEventListeners()
|
||||
@form.data 'form-actions', null
|
||||
|
||||
# Clean form listeners
|
||||
@clearEventListeners()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
= form_for [@project.namespace.becomes(Namespace), @project, @issue], html: { class: 'form-horizontal issue-form gfm-form js-quick-submit js-requires-input' } do |f|
|
||||
= form_for [@project.namespace.becomes(Namespace), @project, @issue], html: { class: 'form-horizontal issue-form common-note-form js-quick-submit js-requires-input' } do |f|
|
||||
= render 'shared/issuable/form', f: f, issuable: @issue
|
||||
|
||||
:javascript
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
|
||||
= render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do
|
||||
= render 'projects/zen', f: f, attr: :description,
|
||||
classes: 'description form-control'
|
||||
classes: 'note-textarea'
|
||||
= render 'projects/notes/hints'
|
||||
.clearfix
|
||||
.error-alert
|
||||
|
|
Loading…
Reference in a new issue