Skip to content

Commit

Permalink
Merge pull request #41 from AppoloDev/develop
Browse files Browse the repository at this point in the history
1.3.1
  • Loading branch information
simonmnt authored Aug 9, 2024
2 parents 3461376 + 1105a4f commit 68fea19
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 20 deletions.
4 changes: 2 additions & 2 deletions dist/icon-picker.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/icon-picker.min.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/themes/bootstrap-5.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/themes/default.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vanilla-icon-picker",
"version": "1.3.0",
"version": "1.3.1",
"description": "Icon picker - Vanilla JS icon picker",
"keywords": [
"ux",
Expand Down
2 changes: 1 addition & 1 deletion src/js/IconPicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ export default class IconPicker {

root.content.appendChild(iconTarget);

this.availableIcons.push({value: key, body: iconElement.outerHTML, ...(categories.length > 0 && {categories})});
this.availableIcons.push({value: key, body: iconElement.outerHTML, ...(categories?.length > 0 && {categories})});

// Icon click event
iconTarget.addEventListener('click', (evt) => {
Expand Down
16 changes: 3 additions & 13 deletions www/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ const iconPickerInput = new IconPicker('input', {
'Iconoir',
'FontAwesome Solid 6',
{
key: 'academicons',
prefix: 'ai ai-',
url: 'https://raw.githubusercontent.com/iconify/icon-sets/master/json/academicons.json'
key: 'gg',
prefix: 'gg-',
url: 'https://raw.githubusercontent.com/iconify/icon-sets/master/json/gg.json'
}
],
closeOnSelect: true
Expand All @@ -26,13 +26,3 @@ iconPickerInput.on('select', (icon) => {
});

// Icon picker with `default` theme
const iconPickerButton = new IconPicker('.btn', {
theme: 'default',
iconSource: ['FontAwesome Brands 6', 'FontAwesome Solid 6', 'FontAwesome Regular 6'],
closeOnSelect: true
});

const iconElementButton = document.querySelector('.icon-selected-text');
iconPickerButton.on('select', (icon) => {
iconElementButton.innerHTML = `Icon selected – name: <b>${icon.name}</b> & value: <b>${icon.value}</b>`;
});

0 comments on commit 68fea19

Please sign in to comment.