javve / list.pagination.js

A pagination plugin for List.js
24 stars 23 forks source link

Where is `parentList` coming from? #16

Open cbier opened 8 years ago

cbier commented 8 years ago

I am trying to modify this plugin so that I can place the pagination outside of the list container. Where is parentList coming from? In other words, what is calling the init() function?

I think if I pass the list object through options I can accomplish what I need to do by assigning the passed in list object to list in this init().

return {
        init: function(parentList) {
            list = parentList;
            pagingList = new List(list.listContainer.id, {
                listClass: options.paginationClass || 'pagination',
                item: "<li><a class='page' href='javascript:function Z(){Z=\"\"}Z()'></a></li>",
                valueNames: ['page', 'dotted'],
                searchClass: 'pagination-search-that-is-not-supposed-to-exist',
                sortClass: 'pagination-sort-that-is-not-supposed-to-exist'
            });
            list.on('updated', refresh);
            refresh();
        },
        name: options.name || "pagination"
    };
cbier commented 8 years ago

I see now it's being called from list.js:775

plugin.init(self, List);