[UPDT] HORILLA VIEWS: Single time hx-trigger while click
This commit is contained in:
@@ -1212,6 +1212,7 @@ class HorillaProfileView(DetailView):
|
|||||||
self.toggle_form = ToggleColumnForm(
|
self.toggle_form = ToggleColumnForm(
|
||||||
self.tabs_list,
|
self.tabs_list,
|
||||||
hidden_tabs,
|
hidden_tabs,
|
||||||
|
hidden_fields=[],
|
||||||
)
|
)
|
||||||
for column in self.tabs_list:
|
for column in self.tabs_list:
|
||||||
if column[1] in hidden_tabs:
|
if column[1] in hidden_tabs:
|
||||||
|
|||||||
@@ -15,10 +15,16 @@
|
|||||||
<li
|
<li
|
||||||
class="oh-tabs__tab d-flex {% if forloop.counter == 1 and not active_target %} oh-tabs__tab--active {% endif %}"
|
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}}"
|
data-target="#{{view_id}}{{forloop.counter}}"
|
||||||
hx-get="{{tab.url}}?{{request.GET.urlencode}}"
|
{% comment %} hx-get="{{tab.url}}?{{request.GET.urlencode}}"
|
||||||
hx-target="#{{view_id}}{{forloop.counter}}"
|
hx-target="#{{view_id}}{{forloop.counter}}" {% endcomment %}
|
||||||
hx-trigger="load"
|
onclick="
|
||||||
onclick="switchTab(event)"
|
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}}
|
{{tab.title}}
|
||||||
<div class="d-flex">
|
<div class="d-flex">
|
||||||
|
|||||||
Reference in New Issue
Block a user