mirror of
https://github.com/zulip/zulip.git
synced 2025-11-19 22:19:48 +00:00
web: Move web app to ‘web’ directory.
Ever since we started bundling the app with webpack, there’s been less and less overlap between our ‘static’ directory (files belonging to the frontend app) and Django’s interpretation of the ‘static’ directory (files served directly to the web). Split the app out to its own ‘web’ directory outside of ‘static’, and remove all the custom collectstatic --ignore rules. This makes it much clearer what’s actually being served to the web, and what’s being bundled by webpack. It also shrinks the release tarball by 3%. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
19
web/src/list_util.ts
Normal file
19
web/src/list_util.ts
Normal file
@@ -0,0 +1,19 @@
|
||||
import $ from "jquery";
|
||||
|
||||
const list_selectors = ["#stream_filters", "#global_filters", "#user_presences"];
|
||||
|
||||
export function inside_list(e: JQuery.KeyDownEvent | JQuery.KeyPressEvent): boolean {
|
||||
const $target = $(e.target);
|
||||
const in_list = $target.closest(list_selectors.join(", ")).length > 0;
|
||||
return in_list;
|
||||
}
|
||||
|
||||
export function go_down(e: JQuery.KeyDownEvent | JQuery.KeyPressEvent): void {
|
||||
const $target = $(e.target);
|
||||
$target.closest("li").next().find("a").trigger("focus");
|
||||
}
|
||||
|
||||
export function go_up(e: JQuery.KeyDownEvent | JQuery.KeyPressEvent): void {
|
||||
const $target = $(e.target);
|
||||
$target.closest("li").prev().find("a").trigger("focus");
|
||||
}
|
||||
Reference in New Issue
Block a user