From 554fff3db0198e94fcb893de1579dc0ab6dd6f41 Mon Sep 17 00:00:00 2001 From: ArtOfCode- Date: Tue, 8 Jun 2021 19:35:21 +0100 Subject: [PATCH] Fix CSS --- app/assets/javascripts/tags.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/app/assets/javascripts/tags.js b/app/assets/javascripts/tags.js index 46399c3c5..50b5ea9ad 100644 --- a/app/assets/javascripts/tags.js +++ b/app/assets/javascripts/tags.js @@ -33,7 +33,7 @@ $(() => { data: function (params) { $this = $(this); // (for the tour) - if ($this.data('tag-set') == "-1") { + if ($this.data('tag-set') === '-1') { return Object.assign(params, { tag_set: "1" }); } return Object.assign(params, { tag_set: $this.data('tag-set') }); @@ -42,17 +42,23 @@ $(() => { delay: 100, processResults: data => { // (for the tour) - if ($this.data('tag-set') == "-1") { + if ($this.data('tag-set') === '-1') { return { results: [ - { id: 1, text: "hot-red-firebreather", desc: "Very cute dragon" }, - { id: 2, text: "training", desc: "How to train a dragon" }, - { id: 3, text: "behavior", desc: "How a dragon behaves" }, - { id: 4, text: "sapphire-blue-waterspouter", desc: "Other cute dragon" } + { id: 1, text: 'hot-red-firebreather', desc: 'Very cute dragon' }, + { id: 2, text: 'training', desc: 'How to train a dragon' }, + { id: 3, text: 'behavior', desc: 'How a dragon behaves' }, + { id: 4, text: 'sapphire-blue-waterspouter', desc: 'Other cute dragon' } ] } } - return {results: data.map(t => ({id: useIds ? t.id : t.name, text: t.name, desc: t.excerpt}))}; + return { + results: data.map(t => ({ + id: useIds ? t.id : t.name, + text: t.name.replace('<', '<').replace('>', '>'), + desc: t.excerpt + })) + }; }, }, templateResult: template