Skip to content

Commit

Permalink
minor Sylius#11052 Disabled all buttons from the column after click (…
Browse files Browse the repository at this point in the history
…kulczy)

This PR was merged into the 1.7-dev branch.

Discussion
----------


![Nagranie z ekranu 2020-01-22 o 12 49 32](https://user-images.githubusercontent.com/15385420/72897231-c960c980-3d21-11ea-81df-0f7e182272f3.gif)

works the same on all index pages with a "transition" buttons (payments, shipments, product reviews...)


Commits
-------

b4db00c Disabled all buttons from the column after click
  • Loading branch information
pamil committed Jan 22, 2020
2 parents bd31f17 + b4db00c commit c32a4fd
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 c32a4fd

Please sign in to comment.