diff --git a/resources/views/adm/icons.twig b/resources/views/adm/icons.twig index 35870c283..4d251d93c 100644 --- a/resources/views/adm/icons.twig +++ b/resources/views/adm/icons.twig @@ -3,34 +3,49 @@ {% block card %} {{ form_open({url: route('adm.icons.save'), method: 'post', id: 'app'}) }} -
+

- - + + + + +
umiejscowienieikona FontAwesome + + + + +
+ +
+
+ + + + - + @@ -55,21 +70,36 @@ delimiters: ['${', '}'], data() { return { - editorIcons, + editorIcons: Object + .entries(editorIcons) + .map(([location, [defaultIcon, currentIcon]]) => { + return {location, defaultIcon, currentIcon}; + }), + searchName: '', + searchIcon: '', }; }, - computed: { - icons() { - return Object.entries(this.$data.editorIcons).map(([location, [defaultIcon, currentIcon]]) => { - return {location, defaultIcon, currentIcon}; - }); - }, - }, methods: { - reset(event) { - event.currentTarget.parentElement.parentElement.querySelector('input[name]').value = ''; + visible({location, defaultIcon, currentIcon}) { + currentIcon = currentIcon.trim(); + if (this.$data.searchName) { + if (!containsCaseInsensitive(location, this.$data.searchName)) { + return false; + } + } + if (this.$data.searchIcon) { + const effectiveIcon = currentIcon === '' ? defaultIcon : currentIcon; + if (!containsCaseInsensitive(effectiveIcon, this.$data.searchIcon)) { + return false; + } + } + return true; }, }, }); + + function containsCaseInsensitive(string, substring) { + return string.toLowerCase().includes(substring.toLocaleString()); + } {% endblock %}
Umiejscowienieikona font-awesome