Skip to content

Commit fb2aa50

Browse files
committed
DOC-240 code cleanup add pills
1 parent 3c81c50 commit fb2aa50

File tree

1 file changed

+45
-19
lines changed

1 file changed

+45
-19
lines changed

src/utils/actions-map-table.md

Lines changed: 45 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,27 +32,41 @@ title: Actions Mapping
3232
}
3333

3434
.button-container {
35-
display:flex;
35+
display: flex;
3636
justify-content: space-around;
3737
}
38+
3839
.button-link {
3940
padding: 4px 10px;
4041
}
4142

4243
.active {
4344
background-color: #eee;
4445
}
46+
47+
.cmode {
48+
background-color: #edeff5;
49+
font-size: 11px;
50+
padding: 0px 6px;
51+
border-radius: 4px;
52+
height: 16px;
53+
font-weight: 600;
54+
text-transform: uppercase;
55+
color: rgb(71, 77, 102);
56+
opacity: 0.65;
57+
}
58+
4559
</style>
4660

4761
## Amplitude settings mapping
4862

4963
<input class="table-search" type="text" id="filterInput" onkeyup="searchFilter()" placeholder="Search for setting..">
5064
<div class="button-container" id="btnContainer">
51-
<a href="#" class="button button-link active" onclick="clickFilter('all')">All</a>
52-
<a href="#" class="button button-link" onclick="clickFilter('true')">Configurable</a>
53-
<a href="#" class="button button-link" onclick="clickFilter('false')">Not Configurable</a>
54-
<a href="#" class="button button-link" onclick="clickFilter('cloud')">Cloud-mode</a>
55-
<a href="#" class="button button-link" onclick="clickFilter('device')">Device-mode</a>
65+
<a href="#" id="all" class="button button-link active">All</a>
66+
<a href="#" id="true" class="button button-link" >Configurable</a>
67+
<a href="#" id="false" class="button button-link" >Not Configurable</a>
68+
<a href="#" id="cloud" class="button button-link">Cloud-mode</a>
69+
<a href="#" id="device" class="button button-link" >Device-mode</a>
5670
</div>
5771

5872
<table id="settingsTable">
@@ -73,9 +87,8 @@ title: Actions Mapping
7387
<tr
7488
class="settingRow {%unless setting.configurable%}no-map{%endunless%} {{setting.configurable}} {% for mode in setting.connection_mode %}{{mode}} {%endfor%}"
7589
id="settingRow">
76-
<td>{{setting.name}} {% for mode in setting.connection_mode %} <img src="/docs/images/{{mode}}-mode-icon.svg"
77-
title="This setting is applicable to {{mode}}-mode connections"
78-
style="border: none; display: inline; margin: 0px; float: right" /> {% endfor %}</td>
90+
<td>{{setting.name}} <br /> {% for mode in setting.connection_mode %}<span
91+
class="cmode">{{mode | capitalize}}-mode</span> {% endfor %}</td>
7992
<!-- <td>{{setting.configurable}}</td> -->
8093
<td>{% if setting.location %}{{setting.location}} <br /> <br /> {% endif %}{{setting.notes}}</td>
8194
</tr>
@@ -106,6 +119,18 @@ title: Actions Mapping
106119
}
107120
clickFilter("all")
108121

122+
var links = document.getElementsByClassName("button-link");
123+
124+
125+
document.querySelectorAll('.button-link').forEach(item => {
126+
let v = item.getAttribute('id');
127+
item.addEventListener('click', (event => {
128+
event.preventDefault();
129+
clickFilter(v);
130+
}))
131+
})
132+
133+
109134
function clickFilter(c) {
110135
var x, i;
111136
x = document.getElementsByClassName("settingRow");
@@ -141,13 +166,14 @@ title: Actions Mapping
141166
element.className = arr1.join(" ");
142167
}
143168

144-
var btnContainer = document.getElementById("btnContainer");
145-
var btns = document.getElementsByClassName("button-link");
146-
for (var i = 0; i < btns.length; i++) {
147-
btns[i].addEventListener("click", function() {
148-
var current = document.getElementsByClassName("active");
149-
current[0].className = current[0].className.replace(" active", "");
150-
this.className += " active";
151-
});
152-
}
153-
</script>
169+
var btnContainer = document.getElementById("btnContainer");
170+
var btns = document.getElementsByClassName("button-link");
171+
for (var i = 0; i < btns.length; i++) {
172+
btns[i].addEventListener("click", function () {
173+
var current = document.getElementsByClassName("active");
174+
current[0].className = current[0].className.replace(" active", "");
175+
this.className += " active";
176+
});
177+
}
178+
179+
</script>

0 commit comments

Comments
 (0)