naver / egjs-infinitegrid

A module used to arrange card elements including content infinitely on a grid layout.
https://naver.github.io/egjs-infinitegrid/
MIT License
2.23k stars 95 forks source link

Is it possible to add scrollContainer attribute? #504

Open Newcandy opened 2 years ago

Newcandy commented 2 years ago

Description

Is it possible to add scrollContainer attribute ? Maybe it can be realized in other way ?

eg:

__proto._init = function () {
    var _a;

    var _b = this.options,
        scrollContainerOption = _b.scrollContainer,
        containerOption = _b.container,
        containerTag = _b.containerTag,
        horizontal = _b.horizontal;
    var wrapper = this.wrapper;
    var scrollContainer = wrapper;
    var container = wrapper;
    var containerCSSText = "";

    if (!containerOption) {
      // scrollContainer = document.body;
      scrollContainer = scrollContainerOption instanceof HTMLElement ? scrollContainerOption : document.querySelector(scrollContainerOption);
      scrollContainer = scrollContainer || document.body;
      containerCSSText = container.style.cssText;
    } else if (containerOption === true) {
        // ...
    } else {
        // ...
    }
    // ...
}

so:

import { MasonryInfiniteGrid } from "@egjs/vue-infinitegrid";
<masonry-infinite-grid
     :container="false"
     :scrollContainer="#Id"
>
// ...
</<masonry-infinite-grid>

Thanks very much!

daybrush commented 2 years ago

@Newcandy

okay. I'll add it.

daybrush commented 2 years ago

@Newcandy

scrollContainer option is added. Check it again.