web: Use util.the for accessing element of single-item lists.

This commit is contained in:
evykassirer
2024-08-19 22:18:02 -07:00
committed by Tim Abbott
parent 113de14547
commit d9f25d01a1
47 changed files with 188 additions and 140 deletions

View File

@@ -2,6 +2,7 @@ import $ from "jquery";
import * as blueslip from "./blueslip";
import * as loading from "./loading";
import * as util from "./util";
export let page_load_time: number | undefined;
@@ -16,7 +17,7 @@ $(() => {
});
$.fn.get_offset_to_window = function () {
return this[0]!.getBoundingClientRect();
return util.the(this).getBoundingClientRect();
};
$.fn.expectOne = function () {