[UPDT] HORILLA VIEWS: Single time hx-trigger while click

This commit is contained in:
Horilla
2025-02-26 20:40:28 +05:30
parent 9a530963b7
commit 5d9072f1fb
2 changed files with 11 additions and 4 deletions

View File

@@ -1212,6 +1212,7 @@ class HorillaProfileView(DetailView):
self.toggle_form = ToggleColumnForm(
self.tabs_list,
hidden_tabs,
hidden_fields=[],
)
for column in self.tabs_list:
if column[1] in hidden_tabs:

View File

@@ -15,10 +15,16 @@
<li
class="oh-tabs__tab d-flex {% if forloop.counter == 1 and not active_target %} oh-tabs__tab--active {% endif %}"
data-target="#{{view_id}}{{forloop.counter}}"
hx-get="{{tab.url}}?{{request.GET.urlencode}}"
hx-target="#{{view_id}}{{forloop.counter}}"
hx-trigger="load"
onclick="switchTab(event)"
{% comment %} hx-get="{{tab.url}}?{{request.GET.urlencode}}"
hx-target="#{{view_id}}{{forloop.counter}}" {% endcomment %}
onclick="
switchTab(event);
if (!this.dataset.processed) {
htmx.ajax('GET', '{{tab.url}}?{{request.GET.urlencode}}', {target: '#{{view_id}}{{forloop.counter}}'});
this.setAttribute('hx-disable', '[true]');
this.dataset.processed = 'true';
}
"
>
{{tab.title}}
<div class="d-flex">