mirror of https://github.com/zulip/zulip.git
js: Convert static/js/padded_widget.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
170905c065
commit
85ae00ce16
|
@ -153,7 +153,6 @@
|
|||
"message_events": false,
|
||||
"message_list": false,
|
||||
"narrow": false,
|
||||
"padded_widget": false,
|
||||
"page_params": false,
|
||||
"panels": false,
|
||||
"pointer": false,
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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: () => {},
|
||||
});
|
||||
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue