summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorPhil Hughes <me@iamphill.com>2016-05-23 09:33:48 +0100
committerPhil Hughes <me@iamphill.com>2016-05-23 09:33:48 +0100
commitd3bdbf55c7505f7d25d9a105d894b7289dfc6bb1 (patch)
treee17a8b2fffd47749318efb40d84c3d7ea30933de /app
parent9052ec8d37537aac58d6ede8faf1b021b7ea60e9 (diff)
downloadgitlab-ce-d3bdbf55c7505f7d25d9a105d894b7289dfc6bb1.tar.gz
Fixed issue with dropdown not opening after removing due dateremove-due-date
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/due_date_select.js.coffee16
1 files changed, 9 insertions, 7 deletions
diff --git a/app/assets/javascripts/due_date_select.js.coffee b/app/assets/javascripts/due_date_select.js.coffee
index 172b4ebe7b1..3cc70185178 100644
--- a/app/assets/javascripts/due_date_select.js.coffee
+++ b/app/assets/javascripts/due_date_select.js.coffee
@@ -24,7 +24,7 @@ class @DueDateSelect
$value.removeAttr('style')
)
- addDueDate = ->
+ addDueDate = (isDropdown) ->
# Create the post date
value = $("input[name='#{fieldName}']").val()
@@ -44,8 +44,9 @@ class @DueDateSelect
data: data
beforeSend: ->
$loading.fadeIn()
- $dropdown.trigger('loading.gl.dropdown')
- $selectbox.hide()
+ if isDropdown
+ $dropdown.trigger('loading.gl.dropdown')
+ $selectbox.hide()
$value.removeAttr('style')
$valueContent.html(mediumDate)
@@ -56,21 +57,22 @@ class @DueDateSelect
else
$('.js-remove-due-date-holder').addClass 'hidden'
).done (data) ->
- $dropdown.trigger('loaded.gl.dropdown')
- $dropdown.dropdown('toggle')
+ if isDropdown
+ $dropdown.trigger('loaded.gl.dropdown')
+ $dropdown.dropdown('toggle')
$loading.fadeOut()
$block.on 'click', '.js-remove-due-date', (e) ->
e.preventDefault()
$("input[name='#{fieldName}']").val ''
- addDueDate()
+ addDueDate(false)
$datePicker.datepicker(
dateFormat: 'yy-mm-dd',
defaultDate: $("input[name='#{fieldName}']").val()
altField: "input[name='#{fieldName}']"
onSelect: ->
- addDueDate()
+ addDueDate(true)
)
$(document)