Skip to content

Commit 27e2dc7

Browse files
committed
Remove create_placeholders_if_missing()
The placeholders have been in the theme since v2021.5
1 parent 7e274eb commit 27e2dc7

File tree

1 file changed

+0
-30
lines changed

1 file changed

+0
-30
lines changed

templates/switchers.js

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -132,41 +132,11 @@
132132
return ''
133133
}
134134

135-
function create_placeholders_if_missing() {
136-
const version_segment = version_segment_from_url();
137-
const language_segment = language_segment_from_url();
138-
const index = "/" + language_segment + version_segment;
139-
140-
if (document.querySelectorAll('.version_switcher_placeholder').length > 0) {
141-
return;
142-
}
143-
144-
const html = '<span class="language_switcher_placeholder"></span> \
145-
<span class="version_switcher_placeholder"></span> \
146-
<a href="/" id="indexlink">Documentation</a> &#187;';
147-
148-
const probable_places = [
149-
"body>div.related>ul>li:not(.right):contains('Documentation'):first",
150-
"body>div.related>ul>li:not(.right):contains('documentation'):first",
151-
];
152-
153-
for (let i = 0; i < probable_places.length; i++) {
154-
let probable_place = $(probable_places[i]);
155-
if (probable_place.length == 1) {
156-
probable_place.html(html);
157-
document.getElementById('indexlink').href = index;
158-
return;
159-
}
160-
}
161-
}
162-
163135
document.addEventListener('DOMContentLoaded', function() {
164136
const language_segment = language_segment_from_url();
165137
const current_language = language_segment.replace(/\/+$/g, '') || 'en';
166138
const version_select = build_version_select(DOCUMENTATION_OPTIONS.VERSION);
167139

168-
create_placeholders_if_missing();
169-
170140
let placeholders = document.querySelectorAll('.version_switcher_placeholder');
171141
placeholders.forEach(function(placeholder) {
172142
placeholder.innerHTML = version_select;

0 commit comments

Comments
 (0)