Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let AlbumScroller = (()=>{
- class AlbumScroller{
- constructor(serviceUrl, containerElm){
- this.InfiniteScroller = new InfiniteScroller(serviceUrl);
- this.ContainerElm = containerElm;
- this.OnFetch = function(r){
- for(let item of r.Items){
- let img = document.createElement("img");
- img.src = item.Url;
- img.alt = item.Description;
- img.dataset.name = item.Name;
- img.dataset.albumid = item.AlbumId;
- img.dataset.albumguid = item.AlbumGuid;
- img.dataset.date = item.Date;
- img.dataset.userid = item.UserId;
- img.dataset.username = item.Username;
- item.dataset.guid = item.Guid;
- img.dataset.guid = item.Guid;
- img.dataset.id = item.Id;
- containerElm.appendChild(img);
- }
- }
- }
- Initialize(){
- let scope = this;
- this.InfiniteScroller.OnScroll = (r)=>{
- scope.OnFetch(r);
- };
- this.InfiniteScroller.Initialize();
- }
- }
- return Album;
- })();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement