Skip to content

Commit ac59fd5

Browse files
committed
Change .djToggleSwitch to a button
1 parent 736edbe commit ac59fd5

File tree

6 files changed

+8
-11
lines changed

6 files changed

+8
-11
lines changed

debug_toolbar/static/debug_toolbar/css/toolbar.css

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,14 +561,12 @@
561561
content: "\00a0";
562562
}
563563
#djDebug .djToggleSwitch {
564-
text-decoration: none;
564+
box-sizing: content-box;
565+
padding: 0;
565566
border: 1px solid #999;
566-
height: 12px;
567+
border-radius: 0;
567568
width: 12px;
568-
line-height: 12px;
569-
text-align: center;
570569
color: #777;
571-
display: inline-block;
572570
background: linear-gradient(to bottom, #fff, #dcdcdc);
573571
}
574572
#djDebug .djNoToggleSwitch {

debug_toolbar/static/debug_toolbar/js/toolbar.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ const djdt = {
9292
});
9393

9494
// Used by the cache, profiling and SQL panels
95-
$$.on(djDebug, "click", "a.djToggleSwitch", function (event) {
96-
event.preventDefault();
95+
$$.on(djDebug, "click", ".djToggleSwitch", function (event) {
9796
const self = this;
9897
const id = this.dataset.toggleId;
9998
const toggleOpen = "+";

debug_toolbar/templates/debug_toolbar/panels/cache.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ <h4>{% trans "Calls" %}</h4>
5151
{% for call in calls %}
5252
<tr id="cacheMain_{{ forloop.counter }}">
5353
<td class="djdt-toggle">
54-
<a class="djToggleSwitch" data-toggle-name="cacheMain" data-toggle-id="{{ forloop.counter }}" href>+</a>
54+
<button class="djToggleSwitch" data-toggle-name="cacheMain" data-toggle-id="{{ forloop.counter }}">+</button>
5555
</td>
5656
<td>{{ call.time|floatformat:"4" }}</td>
5757
<td>{{ call.name|escape }}</td>

debug_toolbar/templates/debug_toolbar/panels/history_tr.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
<p>{{ store_context.toolbar.stats.HistoryPanel.request_url|truncatechars:100|escape }}</p>
1111
</td>
1212
<td>
13-
<a class="djToggleSwitch" data-toggle-name="historyMain" data-toggle-id="{{ id }}" href>+</a>
13+
<button type="button" class="djToggleSwitch" data-toggle-name="historyMain" data-toggle-id="{{ id }}">+</button>
1414
<div class="djUnselected djToggleDetails_{{ id }}">
1515
<table>
1616
<colgroup>

debug_toolbar/templates/debug_toolbar/panels/profiling.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
<td>
1717
<div style="padding-left:{{ call.indent }}px">
1818
{% if call.has_subfuncs %}
19-
<a class="djProfileToggleDetails djToggleSwitch" data-toggle-name="profilingMain" data-toggle-id="{{ call.id }}" href>-</a>
19+
<button type="button" class="djProfileToggleDetails djToggleSwitch" data-toggle-name="profilingMain" data-toggle-id="{{ call.id }}">-</button>
2020
{% else %}
2121
<span class="djNoToggleSwitch"></span>
2222
{% endif %}

debug_toolbar/templates/debug_toolbar/panels/sql.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
<tr class="{% if query.is_slow %} djDebugRowWarning{% endif %}" id="sqlMain_{{ forloop.counter }}">
3535
<td><span class="djdt-color" style="background-color:rgb({{ query.rgb_color|join:', '}})"></span></td>
3636
<td class="djdt-toggle">
37-
<a class="djToggleSwitch" data-toggle-name="sqlMain" data-toggle-id="{{ forloop.counter }}" href="">+</a>
37+
<button type="button" class="djToggleSwitch" data-toggle-name="sqlMain" data-toggle-id="{{ forloop.counter }}">+</button>
3838
</td>
3939
<td class="djdt-query">
4040
<div class="djDebugSqlWrap">

0 commit comments

Comments
 (0)