mirror of
https://github.com/zulip/zulip.git
synced 2026-07-03 21:10:12 +08:00
message_viewport: Modify parameters for dimension wrapper functions.
JQuery's `height` and `width` methods only takes one argument in case we want to set height or width. The argument is of type `string` or `number` or a function. Refrence: https://api.jquery.com/height/#height-value. Therefore, we can get rid of argument array and just accept a single argument in the inner function in `make_dim_wrapper`.
This commit is contained in:
parent
530f4fc763
commit
d4a4e2df3a
@ -18,10 +18,10 @@ function make_dimen_wrapper(dimen_name, dimen_func) {
|
||||
return dimen_func();
|
||||
},
|
||||
});
|
||||
return function viewport_dimension_wrapper(...args) {
|
||||
if (args.length !== 0) {
|
||||
return function viewport_dimension_wrapper(val) {
|
||||
if (val !== undefined) {
|
||||
dimensions[dimen_name].reset();
|
||||
return dimen_func(...args);
|
||||
return dimen_func(val);
|
||||
}
|
||||
return dimensions[dimen_name].get();
|
||||
};
|
||||
|
||||
Loading…
Reference in New Issue
Block a user