Commit ff7fb09e authored by Phil Hughes's avatar Phil Hughes

Updated issue form to use new GLForm

parent 5dd01f57
...@@ -35,7 +35,7 @@ class Dispatcher ...@@ -35,7 +35,7 @@ class Dispatcher
new Diff() new Diff()
when 'projects:issues:new','projects:issues:edit' when 'projects:issues:new','projects:issues:edit'
shortcut_handler = new ShortcutsNavigation() shortcut_handler = new ShortcutsNavigation()
new DropzoneInput($('.issue-form')) new GLForm($('.issue-form'))
new IssuableForm($('.issue-form')) new IssuableForm($('.issue-form'))
when 'projects:merge_requests:new', 'projects:merge_requests:edit' when 'projects:merge_requests:new', 'projects:merge_requests:edit'
new Diff() new Diff()
......
class @GLForm class @GLForm
constructor: (@form) -> 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() @setupForm()
@form.data 'gl-form', @ @form.data 'gl-form', @
...@@ -9,6 +13,8 @@ class @GLForm ...@@ -9,6 +13,8 @@ class @GLForm
destroy: -> destroy: ->
# Destroy actions # Destroy actions
actions = @form.data 'form-actions' actions = @form.data 'form-actions'
if actions?
actions.clearEventListeners() actions.clearEventListeners()
@form.data 'form-actions', null @form.data 'form-actions', null
......
= 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 = render 'shared/issuable/form', f: f, issuable: @issue
:javascript :javascript
......
...@@ -29,7 +29,7 @@ ...@@ -29,7 +29,7 @@
= render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do = render layout: 'projects/md_preview', locals: { preview_class: "md-preview", referenced_users: true } do
= render 'projects/zen', f: f, attr: :description, = render 'projects/zen', f: f, attr: :description,
classes: 'description form-control' classes: 'note-textarea'
= render 'projects/notes/hints' = render 'projects/notes/hints'
.clearfix .clearfix
.error-alert .error-alert
......
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