Skip to content

Commit

Permalink
Rename multiselect attribute to data-multiselect
Browse files Browse the repository at this point in the history
  • Loading branch information
Usbac committed Sep 7, 2024
1 parent a47b8e2 commit ee85cec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/views/admin/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@
<div class="checkbox">
<?php $post_tags = $post['tags'] ?? [] ?>
<?php foreach ($tags as $tag): ?>
<label><input type="checkbox" multiselect name="tags" value="<?= e($tag['id']) ?>" <?php if (array_key_exists($tag['slug'], $post_tags)): ?> checked <?php endif ?>><?= e($tag['name']) ?></label>
<label><input type="checkbox" data-multiselect name="tags" value="<?= e($tag['id']) ?>" <?php if (array_key_exists($tag['slug'], $post_tags)): ?> checked <?php endif ?>><?= e($tag['name']) ?></label>
<?php endforeach ?>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion public/assets/js/admin.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class Form {
let value = el.value;

if (type == 'checkbox') {
if (el.hasAttribute('multiselect')) {
if (el.hasAttribute('data-multiselect')) {
key += '[]';
value = el.checked ? el.getAttribute('value') : undefined;
} else {
Expand Down

0 comments on commit ee85cec

Please sign in to comment.