Skip to content

Commit

Permalink
Disabled all buttons from the column after click
Browse files Browse the repository at this point in the history
  • Loading branch information
kulczy committed Jan 22, 2020
1 parent bd31f17 commit b4db00c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions src/Sylius/Bundle/UiBundle/Resources/private/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,9 @@ $(document).ready(() => {
});

$('[data-form-type="collection"]').CollectionForm();

$('[data-js-disable]').on('click', (e) => {
const $current = $(e.currentTarget);
$(document).find($current.attr('data-js-disable')).not($current).addClass('disabled').prop('disabled', true);
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
<form action="{{ path(options.link.route, options.link.parameters) }}" method="post">
<input type="hidden" name="_csrf_token" value="{{ csrf_token(data.id) }}">
<input type="hidden" name="_method" value="PUT">
<button class="ui loadable {{ options.class|default }} labeled icon button" type="submit"><i class="{{ action.icon }} icon"></i> {{ action.label|trans }}</button>
<button class="ui loadable {{ options.class|default }} labeled icon button" type="submit" data-js-disable=".sylius-grid-table-wrapper button, .sylius-grid-table-wrapper a">
<i class="{{ action.icon }} icon"></i> {{ action.label|trans }}
</button>
</form>
{% endif %}

0 comments on commit b4db00c

Please sign in to comment.