Fixes #3463 - After calling the delete or clone dialog three times, two modal dialogs appear in succession
This commit is contained in:
parent
c80ea0bbc6
commit
95a6625f05
1 changed files with 10 additions and 3 deletions
|
@ -844,13 +844,20 @@ class App.ControllerTable extends App.Controller
|
||||||
toggleActionDropdown: (id, e, td) =>
|
toggleActionDropdown: (id, e, td) =>
|
||||||
e.stopPropagation()
|
e.stopPropagation()
|
||||||
$dropdown = $(td).find('.js-table-action-menu')
|
$dropdown = $(td).find('.js-table-action-menu')
|
||||||
|
|
||||||
if $dropdown.length
|
if $dropdown.length
|
||||||
|
|
||||||
# open dropdown
|
# open dropdown
|
||||||
$dropdown.dropdown('toggle')
|
$dropdown.dropdown('toggle')
|
||||||
|
|
||||||
|
# check if bind to open dropdown is already done
|
||||||
|
return if $dropdown.prop('rendered')
|
||||||
|
|
||||||
|
# remember that bind to open dropdown is already done
|
||||||
|
$dropdown.prop('rendered', true)
|
||||||
|
|
||||||
# bind on click now that the dropdown is open
|
# bind on click now that the dropdown is open
|
||||||
$dropdown.one('click.dropdown', '[data-table-action]', @onActionButtonClicked)
|
$dropdown.on('click.dropdown', '[data-table-action]', @onActionButtonClicked)
|
||||||
# unbind after dropdown is closed
|
|
||||||
$dropdown.parent().one('hide.bs.dropdown', -> $dropdown.off('click.dropdown'))
|
|
||||||
else
|
else
|
||||||
# only one action - directly fire that action
|
# only one action - directly fire that action
|
||||||
name = $(td).find('[data-table-action]').attr('data-table-action')
|
name = $(td).find('[data-table-action]').attr('data-table-action')
|
||||||
|
|
Loading…
Reference in a new issue