Browse Source

Change a behavior of more actions dropdown

Disable more actions dropdown when no instances is selected.

Change-Id: Ida09e51da746ef55768a2c0a75fb27e7b06e6a4c
Closes-Bug: #1668718
changes/90/442290/1
yuki kasuya 5 years ago
parent
commit
c815285c1e
  1. 4
      horizon/static/horizon/js/horizon.tables.js

4
horizon/static/horizon/js/horizon.tables.js

@ -169,15 +169,17 @@ horizon.datatables = {
},
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.each(function () {
var $this = $(this);
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) {
disable_button = $this.find(".table-row-multi-select").filter(":checked").length == 0;
}
$action_buttons.toggleClass("disabled", disable_button);
$more_dropdown.toggleClass("disabled", disable_button);
});
},

Loading…
Cancel
Save