| 
						
						
							
								
							
						
						
					 | 
					 | 
					@ -306,10 +306,11 @@ function widgets.InfiniteList(parent, iterator, opts) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    fwd_iterator:prev() | 
					 | 
					 | 
					 | 
					    fwd_iterator:prev() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  end | 
					 | 
					 | 
					 | 
					  end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  local function add_item(item, index) | 
					 | 
					 | 
					 | 
					  local function add_item(item, index, item_opts) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if not item then | 
					 | 
					 | 
					 | 
					    if not item then | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      return | 
					 | 
					 | 
					 | 
					      return | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    end | 
					 | 
					 | 
					 | 
					    end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    item_opts = item_opts or {} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    local this_item = index | 
					 | 
					 | 
					 | 
					    local this_item = index | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    local add_to_top = false | 
					 | 
					 | 
					 | 
					    local add_to_top = false | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if this_item < first_index then | 
					 | 
					 | 
					 | 
					    if this_item < first_index then | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					 | 
					@ -325,6 +326,9 @@ function widgets.InfiniteList(parent, iterator, opts) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if add_to_top then | 
					 | 
					 | 
					 | 
					    if add_to_top then | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      btn:move_to_index(0) | 
					 | 
					 | 
					 | 
					      btn:move_to_index(0) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    end | 
					 | 
					 | 
					 | 
					    end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    if item_opts.focus then | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					      btn:focus() | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					 | 
					    end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    -- opts.callback should take an item and return a function matching the arg of onClicked | 
					 | 
					 | 
					 | 
					    -- opts.callback should take an item and return a function matching the arg of onClicked | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if opts.callback then | 
					 | 
					 | 
					 | 
					    if opts.callback then | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      btn:onClicked(opts.callback(item)) | 
					 | 
					 | 
					 | 
					      btn:onClicked(opts.callback(item)) | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					 | 
					@ -361,7 +365,7 @@ function widgets.InfiniteList(parent, iterator, opts) | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    if not val then | 
					 | 
					 | 
					 | 
					    if not val then | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					      break | 
					 | 
					 | 
					 | 
					      break | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    end | 
					 | 
					 | 
					 | 
					    end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					    add_item(val, idx) | 
					 | 
					 | 
					 | 
					    add_item(val, idx, { focus = (opts.focus_first_item and idx == 0) }) | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  end | 
					 | 
					 | 
					 | 
					  end | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					 | 
					  return infinite_list | 
					 | 
					 | 
					 | 
					  return infinite_list | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					 | 
					
  |