Fix anchor invalid redirection to search
This commit is contained in:
parent
141e8a6a02
commit
b09a19b7c7
@ -943,9 +943,9 @@
|
|||||||
if (hasClass(main, 'content')) {
|
if (hasClass(main, 'content')) {
|
||||||
removeClass(main, 'hidden');
|
removeClass(main, 'hidden');
|
||||||
}
|
}
|
||||||
var search = document.getElementById('search');
|
var search_c = document.getElementById('search');
|
||||||
if (hasClass(main, 'content')) {
|
if (hasClass(search_c, 'content')) {
|
||||||
addClass(main, 'hidden');
|
addClass(search_c, 'hidden');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Revert to the previous title manually since the History
|
// Revert to the previous title manually since the History
|
||||||
@ -959,7 +959,11 @@
|
|||||||
// perform the search. This will empty the bar if there's
|
// perform the search. This will empty the bar if there's
|
||||||
// nothing there, which lets you really go back to a
|
// nothing there, which lets you really go back to a
|
||||||
// previous state with nothing in the bar.
|
// previous state with nothing in the bar.
|
||||||
document.getElementsByClassName('search-input')[0].value = params.search;
|
if (params.search) {
|
||||||
|
document.getElementsByClassName('search-input')[0].value = params.search;
|
||||||
|
} else {
|
||||||
|
document.getElementsByClassName('search-input')[0].value = '';
|
||||||
|
}
|
||||||
// Some browsers fire 'onpopstate' for every page load
|
// Some browsers fire 'onpopstate' for every page load
|
||||||
// (Chrome), while others fire the event only when actually
|
// (Chrome), while others fire the event only when actually
|
||||||
// popping a state (Firefox), which is why search() is
|
// popping a state (Firefox), which is why search() is
|
||||||
|
Loading…
Reference in New Issue
Block a user