From 2a2172037ecb2467ee5e7053ae1c8a519f58504e Mon Sep 17 00:00:00 2001
From: Yassine Guedidi
Date: Sat, 1 Mar 2025 00:14:40 +0100
Subject: [PATCH] Extract Materialize Tooltip controller
---
.../materialize/tooltip_controller.js | 12 ++++++++++++
assets/index.js | 1 -
templates/Config/index.html.twig | 18 +++++++++---------
templates/Entry/entries.html.twig | 8 ++++----
templates/layout.html.twig | 6 +++---
5 files changed, 28 insertions(+), 17 deletions(-)
create mode 100644 assets/controllers/materialize/tooltip_controller.js
diff --git a/assets/controllers/materialize/tooltip_controller.js b/assets/controllers/materialize/tooltip_controller.js
new file mode 100644
index 000000000..99f2acf3a
--- /dev/null
+++ b/assets/controllers/materialize/tooltip_controller.js
@@ -0,0 +1,12 @@
+import { Controller } from '@hotwired/stimulus';
+import M from '@materializecss/materialize';
+
+export default class extends Controller {
+ connect() {
+ this.instance = M.Tooltip.init(this.element);
+ }
+
+ disconnect() {
+ this.instance.destroy();
+ }
+}
diff --git a/assets/index.js b/assets/index.js
index a40231542..675db5dab 100755
--- a/assets/index.js
+++ b/assets/index.js
@@ -285,7 +285,6 @@ $(document).ready(() => {
constrainWidth: false,
});
- $('.tooltipped').tooltip();
$('.fixed-action-btn').floatingActionButton();
stickyNav();
diff --git a/templates/Config/index.html.twig b/templates/Config/index.html.twig
index 1b4a6a055..585725a19 100644
--- a/templates/Config/index.html.twig
+++ b/templates/Config/index.html.twig
@@ -32,7 +32,7 @@
{{ form_label(form.config.items_per_page) }}
@@ -47,7 +47,7 @@
@@ -64,7 +64,7 @@
@@ -85,7 +85,7 @@
{{ form_label(form.config.language) }}
@@ -102,7 +102,7 @@
@@ -125,7 +125,7 @@
{{ form_label(form.config.font) }}
@@ -136,7 +136,7 @@
{{ form_label(form.config.lineHeight, null, {'label_attr': {'class': 'settings-range-label'}}) }}
@@ -149,7 +149,7 @@
{{ form_label(form.config.fontsize, null, {'label_attr': {'class': 'settings-range-label'}}) }}
@@ -160,7 +160,7 @@
{{ form_label(form.config.maxWidth, null, {'label_attr': {'class': 'settings-range-label'}}) }}
diff --git a/templates/Entry/entries.html.twig b/templates/Entry/entries.html.twig
index d6805027f..59027431f 100644
--- a/templates/Entry/entries.html.twig
+++ b/templates/Entry/entries.html.twig
@@ -24,21 +24,21 @@
{% block nav_panel_extra_actions %}
{% if active_route %}
-
+
casino
{% endif %}
{% if has_filters %}
-
{% endif %}
{% if has_exports %}
-
@@ -61,7 +61,7 @@
{% if list_mode == 0 %}view_list{% else %}view_module{% endif %}
{% endif %}
{% if entries.count > 0 and is_granted('EDIT_ENTRIES') %}
-
+
{% endif %}
{% if app.user.config.feedToken %}
{% include "Entry/_feed_link.html.twig" %}
diff --git a/templates/layout.html.twig b/templates/layout.html.twig
index debb71ac9..172dab47a 100644
--- a/templates/layout.html.twig
+++ b/templates/layout.html.twig
@@ -90,18 +90,18 @@