forked from e621ng/e621ng
[Posts] Fix a bug that broke pressing enter to search (#897)
This commit is contained in:
parent
6430807f67
commit
eb40bd6a99
@ -3,18 +3,6 @@ import Page from "./utility/page";
|
||||
|
||||
const PostSearch = {};
|
||||
|
||||
PostSearch.init = function () {
|
||||
$(".post-search").each((index, element) => {
|
||||
PostSearch.initialize_input($(element));
|
||||
});
|
||||
|
||||
$(".wiki-excerpt").each((index, element) => {
|
||||
PostSearch.initialize_wiki_preview($(element));
|
||||
});
|
||||
|
||||
PostSearch.initialize_controls();
|
||||
};
|
||||
|
||||
PostSearch.initialize_input = function ($form) {
|
||||
const $textarea = $form.find("textarea[name='tags']").first();
|
||||
if (!$textarea.length) return;
|
||||
@ -89,10 +77,19 @@ PostSearch.initialize_controls = function () {
|
||||
};
|
||||
|
||||
$(() => {
|
||||
|
||||
$(".post-search").each((index, element) => {
|
||||
PostSearch.initialize_input($(element));
|
||||
});
|
||||
|
||||
if (!Page.matches("posts", "index") && !Page.matches("favorites"))
|
||||
return;
|
||||
|
||||
PostSearch.init();
|
||||
$(".wiki-excerpt").each((index, element) => {
|
||||
PostSearch.initialize_wiki_preview($(element));
|
||||
});
|
||||
|
||||
PostSearch.initialize_controls();
|
||||
});
|
||||
|
||||
export default PostSearch;
|
||||
|
Loading…
Reference in New Issue
Block a user