Permalink
Browse files

list_render: Return data if no arguments present.

This will return the active data set if no arguments are provided to
the `data` method.
  • Loading branch information...
brockwhittaker authored and timabbott committed Oct 8, 2017
1 parent ae139a7 commit 6d8a8f2b7c79791185b66cdc6ce44be483ca831b
Showing with 7 additions and 0 deletions.
  1. +7 −0 static/js/list_render.js
View
@@ -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;

0 comments on commit 6d8a8f2

Please sign in to comment.