Skip to content

Commit

Permalink
change .hidden css classes to .d-none
Browse files Browse the repository at this point in the history
  • Loading branch information
tamsin johnson authored and dunn committed Oct 30, 2023
1 parent 74f1e76 commit 6a16542
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions app/assets/javascripts/bulkrax/exporters.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function hideUnhide(field) {
}
};

function addRequired(selectedSource) {
function addRequired(selectedSource) {
selectedSource.addClass('required').attr('required', 'required');
selectedSource.parent().addClass('required');
}
Expand All @@ -26,14 +26,14 @@ function removeRequired(allSources) {

// hide all export_source
function hide(allSources) {
allSources.addClass('hidden');
allSources.find('#exporter_export_source').addClass('hidden').attr('type', 'hidden');
allSources.addClass('d-none');
allSources.find('#exporter_export_source').addClass('.d-none').attr('type', 'd-none');
}

// unhide selected export_source
function unhideSelected(selectedSource) {
selectedSource.removeClass('hidden').removeAttr('type');
selectedSource.parent().removeClass('hidden').removeAttr('type');
selectedSource.removeClass('d-none').removeAttr('type');
selectedSource.parent().removeClass('d-none').removeAttr('type');
};

// add the autocomplete javascript
Expand Down
20 changes: 10 additions & 10 deletions app/views/bulkrax/exporters/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,18 +33,18 @@
label: t('bulkrax.exporter.labels.importer'),
required: true,
prompt: 'Select from the list',
label_html: { class: 'importer export-source-option hidden' },
input_html: { class: 'importer export-source-option hidden form-control' },
label_html: { class: 'importer export-source-option d-none' },
input_html: { class: 'importer export-source-option d-none form-control' },
collection: form.object.importers_list.sort %>

<%= form.input :export_source_collection,
prompt: 'Start typing ...',
label: t('bulkrax.exporter.labels.collection'),
required: true,
placeholder: @collection&.title&.first,
label_html: { class: 'collection export-source-option hidden' },
label_html: { class: 'collection export-source-option d-none' },
input_html: {
class: 'collection export-source-option hidden form-control',
class: 'collection export-source-option d-none form-control',
data: {
'autocomplete-url' => '/authorities/search/collections',
'autocomplete' => 'collection'
Expand All @@ -56,8 +56,8 @@
label: t('bulkrax.exporter.labels.worktype'),
required: true,
prompt: 'Select from the list',
label_html: { class: 'worktype export-source-option hidden' },
input_html: { class: 'worktype export-source-option hidden form-control' },
label_html: { class: 'worktype export-source-option d-none' },
input_html: { class: 'worktype export-source-option d-none form-control' },
collection: Bulkrax.curation_concerns.map { |cc| [cc.to_s, cc.to_s] } %>

<%= form.input :limit,
Expand All @@ -80,7 +80,7 @@
as: :boolean,
label: t('bulkrax.exporter.labels.filter_by_date') %>

<div id="date_filter_picker" class="hidden">
<div id="date_filter_picker" class="d-none">
<%= form.input :start_date,
as: :date,
label: t('bulkrax.exporter.labels.start_date'),
Expand Down Expand Up @@ -136,13 +136,13 @@
// get the date filter option and show the corresponding date selectors
$('.exporter_date_filter').change(function () {
if ($('.exporter_date_filter').find(".boolean").is(":checked"))
$('#date_filter_picker').removeClass('hidden');
$('#date_filter_picker').removeClass('d-none');
else
$('#date_filter_picker').addClass('hidden');
$('#date_filter_picker').addClass('d-none');
});

if ($('.exporter_date_filter').find(".boolean").is(":checked"))
$('#date_filter_picker').removeClass('hidden');
$('#date_filter_picker').removeClass('d-none');
});
});
</script>

0 comments on commit 6a16542

Please sign in to comment.