diff options
| author | Teddy Wing | 2018-01-31 13:23:24 +0100 |
|---|---|---|
| committer | Teddy Wing | 2018-01-31 13:23:24 +0100 |
| commit | 9c322a5ea47f0badb0ba7e91de6df42d25e591c5 (patch) | |
| tree | 28c4ad1c67581d777a857e686a78607e5db16e79 /spec/javascript/time_table | |
| parent | 883889a9b23feea6530936b8371c6557f5a4956a (diff) | |
| download | chouette-core-9c322a5ea47f0badb0ba7e91de6df42d25e591c5.tar.bz2 | |
VehicleJourneys#index: Allow company deletion in 'add' modal5574-vehicle-journeys--fix-transporter-deletion-in-modal--rb
While the 'x' button in the Select2 was available in the 'edit' modal
for a vehicle journey, it was not in the 'add' modal. Thus, once you
added an associated company, you couldn't remove it in the modal. You'd
either have to cancel and create your vehicle journey again, or create
it an delete the company in the 'edit' modal later.
This enables the 'x' button in the 'add' modal (it previously was only
enabled when `editMode` was active) and sets the proper action/reducer
to remove the company.
The `allowClear` attribute was changed to only work in the 'edit' modal
in 0079238842263768b88b0fa0fd977824b49eabd5. That commit appears to be
changing things so that certain functions work when not in 'edit' mode.
The case we're concerned about is that the 'edit' modal can be opened
when in 'view' mode (not 'edit' mode) in order to get more detailed
information about a vehicle journey. This means the company Select2 is
available in 'view' mode, and the 'x' button should not be visible in
that case. But, when I tested this, even with `allowClear: true`, the
'x' button wasn't visible. This, I can only assume, is because the
Select2 is in a 'disabled' state, so it's smart enough to know not to
show the 'x' button. Which works great for us, because this allows us to
not show the 'x' button here and still show it in the 'add' and 'edit'
modals.
Refs #5574
Diffstat (limited to 'spec/javascript/time_table')
0 files changed, 0 insertions, 0 deletions
