uploads: allow changing thumbnail size on My Uploads / All Uploads pages.
* Add a "Size" menu to the My Uploads / All Uploads pages to allow changing the thumbnail size. * Make the My Uploads / All Uploads pages use the same thumbnail size as the post index page. * Change the "Gallery | Table" links on the My Uploads page to icons.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
import Cookie from './cookie';
|
||||
|
||||
export default class PreviewSizeMenuComponent {
|
||||
static initialize() {
|
||||
$(document).on("click.danbooru", ".preview-size-menu .popup-menu-content a", e => PreviewSizeMenuComponent.onClick(e));
|
||||
}
|
||||
|
||||
static onClick(e) {
|
||||
let url = new URL($(e.target).get(0).href);
|
||||
let size = url.searchParams.get("size");
|
||||
|
||||
Cookie.put("post_preview_size", size);
|
||||
url.searchParams.delete("size");
|
||||
location.replace(url);
|
||||
|
||||
e.preventDefault();
|
||||
}
|
||||
}
|
||||
|
||||
$(PreviewSizeMenuComponent.initialize);
|
||||
Reference in New Issue
Block a user