mirror of https://github.com/zulip/zulip.git
list_render: Return data if no arguments present.
This will return the active data set if no arguments are provided to the `data` method.
This commit is contained in:
parent
ae139a78b8
commit
6d8a8f2b7c
|
@ -121,6 +121,13 @@ var list_render = (function () {
|
|||
// initializing a new progressive list render instance, you can just
|
||||
// update the data of an existing one.
|
||||
data: function (data) {
|
||||
// if no args are provided then just return the existing data.
|
||||
// this interface is similar to how many jQuery functions operate,
|
||||
// where a call to the method without data returns the existing data.
|
||||
if (typeof data === "undefined" && arguments.length === 0) {
|
||||
return meta.list;
|
||||
}
|
||||
|
||||
if (Array.isArray(data)) {
|
||||
meta.list = data;
|
||||
|
||||
|
|
Loading…
Reference in New Issue