forked from e621ng/e621ng
[Posts] Posts searchbar and layout fixes (#868)
* Remove the strange search button styles on the posts/show page * Remove debug console output * Tweak the searchbar styles to be consistent across the pages
This commit is contained in:
parent
8628351bc5
commit
51fe187fbb
@ -19,25 +19,28 @@ PostSearch.initialize_input = function ($form) {
|
|||||||
|
|
||||||
// Adjust the number of rows based on input length
|
// Adjust the number of rows based on input length
|
||||||
$textarea
|
$textarea
|
||||||
.on("input", () => {
|
.on("input", recalculateInputHeight)
|
||||||
$textarea.css("height", 0);
|
|
||||||
$textarea.css("height", element.scrollHeight + "px");
|
|
||||||
})
|
|
||||||
.on("keypress", function (event) {
|
.on("keypress", function (event) {
|
||||||
if (event.which !== 13 || event.shiftKey) return;
|
if (event.which !== 13 || event.shiftKey) return;
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
$textarea.closest("form").submit();
|
$textarea.closest("form").submit();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$(window).on("resize", recalculateInputHeight);
|
||||||
|
|
||||||
// Reset default height
|
// Reset default height
|
||||||
$textarea.trigger("input");
|
recalculateInputHeight();
|
||||||
|
|
||||||
|
function recalculateInputHeight () {
|
||||||
|
$textarea.css("height", 0);
|
||||||
|
$textarea.css("height", element.scrollHeight + "px");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
PostSearch.initialize_wiki_preview = function ($preview) {
|
PostSearch.initialize_wiki_preview = function ($preview) {
|
||||||
let visible = LStorage.Posts.WikiExcerpt;
|
let visible = LStorage.Posts.WikiExcerpt;
|
||||||
if (visible)
|
if (visible)
|
||||||
$preview.removeClass("hidden");
|
$preview.removeClass("hidden");
|
||||||
console.log("init", visible);
|
|
||||||
|
|
||||||
$($preview.find("a.wiki-excerpt-toggle")).on("click", (event) => {
|
$($preview.find("a.wiki-excerpt-toggle")).on("click", (event) => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
@ -45,7 +48,6 @@ PostSearch.initialize_wiki_preview = function ($preview) {
|
|||||||
visible = !visible;
|
visible = !visible;
|
||||||
$preview.toggleClass("hidden", !visible);
|
$preview.toggleClass("hidden", !visible);
|
||||||
LStorage.Posts.WikiExcerpt = visible;
|
LStorage.Posts.WikiExcerpt = visible;
|
||||||
console.log("state", visible);
|
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
@ -14,7 +14,9 @@
|
|||||||
|
|
||||||
// Override default texarea styles
|
// Override default texarea styles
|
||||||
font-family: Verdana, sans-serif;
|
font-family: Verdana, sans-serif;
|
||||||
font-size: 1.05em;
|
font-size: 1rem;
|
||||||
|
line-height: 1rem;
|
||||||
|
padding: 0.5rem 0 0.5rem 0.5rem;
|
||||||
|
|
||||||
// Remove old styles from z_responsive
|
// Remove old styles from z_responsive
|
||||||
vertical-align: unset;
|
vertical-align: unset;
|
||||||
@ -28,11 +30,9 @@
|
|||||||
// Disable manual resizing
|
// Disable manual resizing
|
||||||
resize: none;
|
resize: none;
|
||||||
|
|
||||||
flex: 1;
|
|
||||||
padding: 0.5em;
|
|
||||||
|
|
||||||
border-radius: 3px 0 0 3px;
|
border-radius: 3px 0 0 3px;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
flex: 1;
|
||||||
|
|
||||||
&:focus, &:focus + button[type="submit"] { background: #FFC; }
|
&:focus, &:focus + button[type="submit"] { background: #FFC; }
|
||||||
}
|
}
|
||||||
@ -43,13 +43,20 @@
|
|||||||
font-size: unset;
|
font-size: unset;
|
||||||
max-width: unset;
|
max-width: unset;
|
||||||
|
|
||||||
font-size: 1em;
|
font-size: 1rem;
|
||||||
padding: 0.5em;
|
line-height: 1rem;
|
||||||
|
padding: 0.5rem;
|
||||||
|
|
||||||
border-radius: 0 3px 3px 0;
|
border-radius: 0 3px 3px 0;
|
||||||
background: white;
|
background: white;
|
||||||
|
|
||||||
span { display: none; }
|
span { display: none; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@include window-larger-than(800px) {
|
||||||
|
textarea, button[type="submit"] {
|
||||||
|
font-size: 0.85rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,22 +67,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
div#page aside#sidebar {
|
|
||||||
padding: 5px;
|
|
||||||
|
|
||||||
input#tags {
|
|
||||||
width: 80%;
|
|
||||||
}
|
|
||||||
|
|
||||||
button[type=submit] {
|
|
||||||
font-size: 1.2em;
|
|
||||||
background-color: #EEE;
|
|
||||||
height: 42px;
|
|
||||||
padding: 2px 10px;
|
|
||||||
border: 1px solid rgb(197, 197, 197);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
div#page {
|
div#page {
|
||||||
|
|
||||||
> div /* div#c-$controller */
|
> div /* div#c-$controller */
|
||||||
|
Loading…
Reference in New Issue
Block a user