js: Convert static/js/padded_widget.js to ES6 module.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2021-02-27 16:12:54 -08:00 committed by Tim Abbott
parent 170905c065
commit 85ae00ce16
7 changed files with 6 additions and 12 deletions

View File

@ -153,7 +153,6 @@
"message_events": false,
"message_list": false,
"narrow": false,
"padded_widget": false,
"page_params": false,
"panels": false,
"pointer": false,

View File

@ -69,7 +69,7 @@ const _resize = {
resize_page_components: () => {},
};
set_global("padded_widget", {
rewiremock("../../static/js/padded_widget").with({
update_padding: () => {},
});
rewiremock("../../static/js/channel").with(channel);

View File

@ -5,11 +5,11 @@ const {strict: assert} = require("assert");
const _ = require("lodash");
const rewiremock = require("rewiremock/node");
const {set_global, zrequire} = require("../zjsunit/namespace");
const {zrequire} = require("../zjsunit/namespace");
const {run_test} = require("../zjsunit/test");
const $ = require("../zjsunit/zjquery");
set_global("padded_widget", {
rewiremock("../../static/js/padded_widget").with({
update_padding: () => {},
});

View File

@ -5,6 +5,7 @@ const render_user_presence_rows = require("../templates/user_presence_rows.hbs")
const buddy_data = require("./buddy_data");
const message_viewport = require("./message_viewport");
const padded_widget = require("./padded_widget");
class BuddyListConf {
container_sel = "#user_presences";

View File

@ -33,7 +33,6 @@ import "../notifications";
import "../message_events";
import "../server_events";
import "../zulip";
import "../padded_widget";
import "../buddy_list";
import "../activity";
import "../user_events";

View File

@ -26,7 +26,6 @@ declare let input_pill: any;
declare let message_events: any;
declare let message_list: any;
declare let narrow: any;
declare let padded_widget: any;
declare let page_params: any;
declare let panels: any;
declare let pointer: any;

View File

@ -1,6 +1,4 @@
"use strict";
exports.update_padding = function (opts) {
export function update_padding(opts) {
const content = $(opts.content_sel);
const padding = $(opts.padding_sel);
const total_rows = opts.total_rows;
@ -19,6 +17,4 @@ exports.update_padding = function (opts) {
padding.height(new_padding_height);
padding.width(1);
};
window.padded_widget = exports;
}