Change a behavior of more actions dropdown
Disable more actions dropdown when no instances is selected. Change-Id: Ida09e51da746ef55768a2c0a75fb27e7b06e6a4c Closes-Bug: #1668718
This commit is contained in:
parent
8a2da91ff9
commit
c815285c1e
|
@ -169,15 +169,17 @@ horizon.datatables = {
|
||||||
},
|
},
|
||||||
|
|
||||||
validate_button: function ($form, disable_button) {
|
validate_button: function ($form, disable_button) {
|
||||||
// Enable or disable table batch action buttons based on row selection.
|
// Enable or disable table batch action buttons and more actions dropdown based on row selection.
|
||||||
$form = $form || $(".table_wrapper > form");
|
$form = $form || $(".table_wrapper > form");
|
||||||
$form.each(function () {
|
$form.each(function () {
|
||||||
var $this = $(this);
|
var $this = $(this);
|
||||||
var $action_buttons = $this.find('.table_actions button[data-batch-action="true"]');
|
var $action_buttons = $this.find('.table_actions button[data-batch-action="true"]');
|
||||||
|
var $more_dropdown = $this.find('.table_actions_menu > a.dropdown-toggle');
|
||||||
if (disable_button === undefined) {
|
if (disable_button === undefined) {
|
||||||
disable_button = $this.find(".table-row-multi-select").filter(":checked").length == 0;
|
disable_button = $this.find(".table-row-multi-select").filter(":checked").length == 0;
|
||||||
}
|
}
|
||||||
$action_buttons.toggleClass("disabled", disable_button);
|
$action_buttons.toggleClass("disabled", disable_button);
|
||||||
|
$more_dropdown.toggleClass("disabled", disable_button);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue