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,8 +44,9 @@ class @DueDateSelect ...@@ -44,8 +44,9 @@ class @DueDateSelect
data: data data: data
beforeSend: -> beforeSend: ->
$loading.fadeIn() $loading.fadeIn()
$dropdown.trigger('loading.gl.dropdown') if isDropdown
$selectbox.hide() $dropdown.trigger('loading.gl.dropdown')
$selectbox.hide()
$value.removeAttr('style') $value.removeAttr('style')
$valueContent.html(mediumDate) $valueContent.html(mediumDate)
...@@ -56,21 +57,22 @@ class @DueDateSelect ...@@ -56,21 +57,22 @@ class @DueDateSelect
else else
$('.js-remove-due-date-holder').addClass 'hidden' $('.js-remove-due-date-holder').addClass 'hidden'
).done (data) -> ).done (data) ->
$dropdown.trigger('loaded.gl.dropdown') if isDropdown
$dropdown.dropdown('toggle') $dropdown.trigger('loaded.gl.dropdown')
$dropdown.dropdown('toggle')
$loading.fadeOut() $loading.fadeOut()
$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