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_events": false,
|
||||||
"message_list": false,
|
"message_list": false,
|
||||||
"narrow": false,
|
"narrow": false,
|
||||||
"padded_widget": false,
|
|
||||||
"page_params": false,
|
"page_params": false,
|
||||||
"panels": false,
|
"panels": false,
|
||||||
"pointer": false,
|
"pointer": false,
|
||||||
|
|
|
@ -69,7 +69,7 @@ const _resize = {
|
||||||
resize_page_components: () => {},
|
resize_page_components: () => {},
|
||||||
};
|
};
|
||||||
|
|
||||||
set_global("padded_widget", {
|
rewiremock("../../static/js/padded_widget").with({
|
||||||
update_padding: () => {},
|
update_padding: () => {},
|
||||||
});
|
});
|
||||||
rewiremock("../../static/js/channel").with(channel);
|
rewiremock("../../static/js/channel").with(channel);
|
||||||
|
|
|
@ -5,11 +5,11 @@ const {strict: assert} = require("assert");
|
||||||
const _ = require("lodash");
|
const _ = require("lodash");
|
||||||
const rewiremock = require("rewiremock/node");
|
const rewiremock = require("rewiremock/node");
|
||||||
|
|
||||||
const {set_global, zrequire} = require("../zjsunit/namespace");
|
const {zrequire} = require("../zjsunit/namespace");
|
||||||
const {run_test} = require("../zjsunit/test");
|
const {run_test} = require("../zjsunit/test");
|
||||||
const $ = require("../zjsunit/zjquery");
|
const $ = require("../zjsunit/zjquery");
|
||||||
|
|
||||||
set_global("padded_widget", {
|
rewiremock("../../static/js/padded_widget").with({
|
||||||
update_padding: () => {},
|
update_padding: () => {},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@ const render_user_presence_rows = require("../templates/user_presence_rows.hbs")
|
||||||
|
|
||||||
const buddy_data = require("./buddy_data");
|
const buddy_data = require("./buddy_data");
|
||||||
const message_viewport = require("./message_viewport");
|
const message_viewport = require("./message_viewport");
|
||||||
|
const padded_widget = require("./padded_widget");
|
||||||
|
|
||||||
class BuddyListConf {
|
class BuddyListConf {
|
||||||
container_sel = "#user_presences";
|
container_sel = "#user_presences";
|
||||||
|
|
|
@ -33,7 +33,6 @@ import "../notifications";
|
||||||
import "../message_events";
|
import "../message_events";
|
||||||
import "../server_events";
|
import "../server_events";
|
||||||
import "../zulip";
|
import "../zulip";
|
||||||
import "../padded_widget";
|
|
||||||
import "../buddy_list";
|
import "../buddy_list";
|
||||||
import "../activity";
|
import "../activity";
|
||||||
import "../user_events";
|
import "../user_events";
|
||||||
|
|
|
@ -26,7 +26,6 @@ declare let input_pill: any;
|
||||||
declare let message_events: any;
|
declare let message_events: any;
|
||||||
declare let message_list: any;
|
declare let message_list: any;
|
||||||
declare let narrow: any;
|
declare let narrow: any;
|
||||||
declare let padded_widget: any;
|
|
||||||
declare let page_params: any;
|
declare let page_params: any;
|
||||||
declare let panels: any;
|
declare let panels: any;
|
||||||
declare let pointer: any;
|
declare let pointer: any;
|
||||||
|
|
|
@ -1,6 +1,4 @@
|
||||||
"use strict";
|
export function update_padding(opts) {
|
||||||
|
|
||||||
exports.update_padding = function (opts) {
|
|
||||||
const content = $(opts.content_sel);
|
const content = $(opts.content_sel);
|
||||||
const padding = $(opts.padding_sel);
|
const padding = $(opts.padding_sel);
|
||||||
const total_rows = opts.total_rows;
|
const total_rows = opts.total_rows;
|
||||||
|
@ -19,6 +17,4 @@ exports.update_padding = function (opts) {
|
||||||
|
|
||||||
padding.height(new_padding_height);
|
padding.height(new_padding_height);
|
||||||
padding.width(1);
|
padding.width(1);
|
||||||
};
|
}
|
||||||
|
|
||||||
window.padded_widget = exports;
|
|
||||||
|
|
Loading…
Reference in New Issue