Skip to content

Commit

Permalink
create scrips file
Browse files Browse the repository at this point in the history
  • Loading branch information
ElviaBth committed Jan 18, 2024
1 parent 1551ba1 commit 825e101
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .ruby-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.1.1
3.1.1
14 changes: 7 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GIT
remote: https://github.com/decidim/decidim.git
revision: 9dea35e0b8f5ab9c52433d05f4a48b8ad299e664
revision: dbd148e3733988d8d8bc1faef84846082e6ffdbd
branch: release/0.28-stable
specs:
decidim (0.28.0)
Expand Down Expand Up @@ -264,11 +264,11 @@ GEM
parser (>= 2.4)
smart_properties
bindex (0.8.1)
bootsnap (1.17.0)
bootsnap (1.17.1)
msgpack (~> 1.2)
browser (2.7.1)
builder (3.2.4)
bullet (7.1.5)
bullet (7.1.6)
activesupport (>= 3.0.0)
uniform_notifier (~> 1.11)
byebug (11.1.3)
Expand Down Expand Up @@ -305,7 +305,7 @@ GEM
json
simplecov
commonmarker (0.23.10)
concurrent-ruby (1.2.2)
concurrent-ruby (1.2.3)
crack (0.4.5)
rexml
crass (1.0.6)
Expand Down Expand Up @@ -359,7 +359,7 @@ GEM
factory_bot_rails (6.4.3)
factory_bot (~> 6.4)
railties (>= 5.0.0)
faker (3.2.2)
faker (3.2.3)
i18n (>= 1.8.11, < 2)
faraday (2.9.0)
faraday-net_http (>= 2.0, < 3.2)
Expand Down Expand Up @@ -465,7 +465,7 @@ GEM
mime-types-data (3.2023.1205)
mini_magick (4.12.0)
mini_mime (1.1.5)
minitest (5.20.0)
minitest (5.21.1)
msgpack (1.7.2)
multi_xml (0.6.0)
mustache (1.1.1)
Expand Down Expand Up @@ -527,7 +527,7 @@ GEM
parallel (1.24.0)
parallel_tests (4.4.0)
parallel
parser (3.3.0.2)
parser (3.3.0.4)
ast (~> 2.4.1)
racc
pg (1.4.6)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<script>
document.addEventListener('DOMContentLoaded', function () {
const accordionItems = document.querySelectorAll('.accordion-item');
accordionItems.forEach(function (item) {
const title = item.querySelector('.accordion-title');
let content = item.querySelector('.accordion-content');
content.style.display = 'none';

title.addEventListener('click', function () {

content = item.querySelector('.accordion-content');
content.style.display = content.style.display === 'none' ? 'block' : 'none';
});
});
});
</script>
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
<%= stylesheet_pack_tag "decidim_newsletter_agenda", media: :all %>
<% form.fields_for :settings, settings do |settings_fields| %>
<%= settings_fields.text_field :link_color, label: t(".link_color"), type: "color" %>
<%= settings_fields.text_field :background_color, label: t(".background_color"), type: "color" %>
Expand Down Expand Up @@ -110,5 +113,4 @@
<%= t(".interpolations_hint") %>
</div>

<%= stylesheet_pack_tag "decidim_newsletter_agenda" %>
<%= append_javascript_pack_tag "decidim_newsletter_agenda" %>
<%= render :scripts %>
20 changes: 0 additions & 20 deletions app/packs/entrypoints/decidim_newsletter_agenda.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,3 @@ import "./decidim_newsletter_agenda.scss";
// Images
require.context("../images", true)
require.context("../fonts", true)


document.addEventListener('DOMContentLoaded', function () {

const accordionItems = document.querySelectorAll('.accordion-item');
console.log("hola");
accordionItems.forEach(function (item) {

const title = item.querySelector('.accordion-title');
let content = item.querySelector('.accordion-content');
console.log(content.style.display);
content.style.display = 'none';

title.addEventListener('click', function () {

content = item.querySelector('.accordion-content');
content.style.display = content.style.display === 'none' ? 'block' : 'none';
});
});
});

0 comments on commit 825e101

Please sign in to comment.