Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include tags to plugins #11

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

TChukwuleta
Copy link
Contributor

Allow plugin owners to specify tags, such that on BTCPay, filters are easy to carry out.

@NicolasDorier

Comment on lines 68 to 91
document.addEventListener('DOMContentLoaded', function () {
var checkboxes = document.querySelectorAll('.category-checkbox');
var selectedCategoriesInput = document.getElementById('SelectedCategories');
var dropdownButton = document.getElementById('dropdownMenuButton');
function updateButtonLabel() {
var selectedCategories = [];
checkboxes.forEach(function (cb) {
if (cb.checked) {
selectedCategories.push(cb.value);
}
});
selectedCategoriesInput.value = selectedCategories.join(',');

if (selectedCategories.length > 0) {
dropdownButton.textContent = selectedCategories.length + ' tag' + (selectedCategories.length > 1 ? 's' : '') + ' selected';
} else {
dropdownButton.textContent = 'Select tags';
}
}
checkboxes.forEach(function (checkbox) {
checkbox.addEventListener('change', updateButtonLabel);
});
updateButtonLabel();
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can put this in a separate JS file to avoid duplication. You could also encapsulate the view part above in a view component and eliminate that duplication too this way.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decided to remove that, and use just input for tags using tom-select.

You can go ahead and review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants