Commit d3bdbf55 authored by Phil Hughes's avatar Phil Hughes

Fixed issue with dropdown not opening after removing due date

parent 9052ec8d
...@@ -24,7 +24,7 @@ class @DueDateSelect ...@@ -24,7 +24,7 @@ class @DueDateSelect
$value.removeAttr('style') $value.removeAttr('style')
) )
addDueDate = -> addDueDate = (isDropdown) ->
# Create the post date # Create the post date
value = $("input[name='#{fieldName}']").val() value = $("input[name='#{fieldName}']").val()
...@@ -44,6 +44,7 @@ class @DueDateSelect ...@@ -44,6 +44,7 @@ class @DueDateSelect
data: data data: data
beforeSend: -> beforeSend: ->
$loading.fadeIn() $loading.fadeIn()
if isDropdown
$dropdown.trigger('loading.gl.dropdown') $dropdown.trigger('loading.gl.dropdown')
$selectbox.hide() $selectbox.hide()
$value.removeAttr('style') $value.removeAttr('style')
...@@ -56,6 +57,7 @@ class @DueDateSelect ...@@ -56,6 +57,7 @@ class @DueDateSelect
else else
$('.js-remove-due-date-holder').addClass 'hidden' $('.js-remove-due-date-holder').addClass 'hidden'
).done (data) -> ).done (data) ->
if isDropdown
$dropdown.trigger('loaded.gl.dropdown') $dropdown.trigger('loaded.gl.dropdown')
$dropdown.dropdown('toggle') $dropdown.dropdown('toggle')
$loading.fadeOut() $loading.fadeOut()
...@@ -63,14 +65,14 @@ class @DueDateSelect ...@@ -63,14 +65,14 @@ class @DueDateSelect
$block.on 'click', '.js-remove-due-date', (e) -> $block.on 'click', '.js-remove-due-date', (e) ->
e.preventDefault() e.preventDefault()
$("input[name='#{fieldName}']").val '' $("input[name='#{fieldName}']").val ''
addDueDate() addDueDate(false)
$datePicker.datepicker( $datePicker.datepicker(
dateFormat: 'yy-mm-dd', dateFormat: 'yy-mm-dd',
defaultDate: $("input[name='#{fieldName}']").val() defaultDate: $("input[name='#{fieldName}']").val()
altField: "input[name='#{fieldName}']" altField: "input[name='#{fieldName}']"
onSelect: -> onSelect: ->
addDueDate() addDueDate(true)
) )
$(document) $(document)
......
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