Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

css_variables: Directly export number values for breakpoints.

Aman Agrawal14d3385bfdef
diff --git a/static/js/css_variables.js b/static/js/css_variables.js
index 9a11287b49d..7adee87dd1d 100644
--- a/static/js/css_variables.js
+++ b/static/js/css_variables.js
@@ -25,4 +25,15 @@ module.exports = {
mm_min: mm + "px",
ms_min: ms + "px",
},
+
+ media_breakpoints_num: {
+ xs,
+ sm,
+ md,
+ lg,
+ xl,
+ ml,
+ mm,
+ ms,
+ },
};
diff --git a/static/js/message_viewport.js b/static/js/message_viewport.js
index a767371f55a..8707c208cf2 100644
--- a/static/js/message_viewport.js
+++ b/static/js/message_viewport.js
@@ -1,7 +1,7 @@
import $ from "jquery";
import * as blueslip from "./blueslip";
-import {media_breakpoints} from "./css_variables";
+import {media_breakpoints_num} from "./css_variables";
import * as message_lists from "./message_lists";
import * as message_scroll from "./message_scroll";
import * as rows from "./rows";
@@ -314,7 +314,7 @@ export function is_narrow() {
// This basically returns true when we hide the right sidebar for
// the left_side_userlist skinny mode. It would be nice to have a less brittle
// test for this.
- return window.innerWidth < Number(media_breakpoints.xl_min.slice(0, -2));
+ return window.innerWidth < media_breakpoints_num.xl;
}
export function system_initiated_animate_scroll(scroll_amount) {