Skip to content

Commit 8672a82

Browse files
committed
refactor(defaultTheme): remove legacy compat API guard
1 parent 4aa3a98 commit 8672a82

File tree

1 file changed

+1
-31
lines changed

1 file changed

+1
-31
lines changed

src/tpl/defaultTheme/frontend/index.js

Lines changed: 1 addition & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,6 @@
3939
var lastFocused;
4040

4141
function enableFilter() {
42-
if (!document.querySelector) {
43-
var filter = document.getElementById && document.getElementById('panel-filter');
44-
if (filter) {
45-
filter.className += ' none';
46-
}
47-
return;
48-
}
49-
5042
// pre check
5143
var filter = document.body.querySelector('.filter');
5244
if (!filter) {
@@ -187,8 +179,6 @@
187179
}
188180

189181
function keepFocusOnBackwardForward() {
190-
if (window.onpageshow === undefined || !document.querySelector) return;
191-
192182
function onFocus(e) {
193183
var link = e.target;
194184
while (link && !(link instanceof HTMLAnchorElement)) {
@@ -210,8 +200,6 @@
210200
}
211201

212202
function focusChildOnNavUp() {
213-
if (!document.querySelector) return;
214-
215203
function extractCleanUrl(url) {
216204
var sepIndex = url.indexOf('?');
217205
if (sepIndex < 0) sepIndex = url.indexOf('#');
@@ -261,14 +249,6 @@
261249
}
262250

263251
function enableKeyboardNavigate() {
264-
if (
265-
!document.querySelector ||
266-
!document.addEventListener ||
267-
!document.body.parentElement
268-
) {
269-
return;
270-
}
271-
272252
var pathList = document.body.querySelector('.path-list');
273253
var itemList = document.body.querySelector('.item-list');
274254
if (!pathList && !itemList) {
@@ -536,10 +516,6 @@
536516
}
537517

538518
function enhanceUpload() {
539-
if (!document.querySelector || !document.addEventListener) {
540-
return;
541-
}
542-
543519
var upload = document.body.querySelector('.upload');
544520
if (!upload) {
545521
return;
@@ -1197,14 +1173,8 @@
11971173
}
11981174

11991175
function enableNonRefreshDelete() {
1200-
if (!document.querySelector) {
1201-
return;
1202-
}
1203-
12041176
var itemList = document.body.querySelector('.item-list');
1205-
if (!itemList || !itemList.addEventListener) {
1206-
return;
1207-
}
1177+
if (!itemList) return;
12081178
if (!itemList.classList.contains('has-deletable')) return;
12091179

12101180
itemList.addEventListener('submit', function (e) {

0 commit comments

Comments
 (0)