Show folders first in dir lists
This commit is contained in:
		
							parent
							
								
									0d2d356e93
								
							
						
					
					
						commit
						9625e9cbb2
					
				| @ -4,7 +4,14 @@ export default Component.extend({ | ||||
| 
 | ||||
|   classNames: ['directory-listing'], | ||||
| 
 | ||||
|   items: null | ||||
|   items: null, | ||||
| 
 | ||||
|   itemsSorted: function() { | ||||
|     let items = this.get('items'); | ||||
| 
 | ||||
|     // folders first
 | ||||
|     return items.reject(i => i.type !== 'folder') | ||||
|                 .concat(items.reject(i => i.type === 'folder')); | ||||
|   }.property('items') | ||||
| 
 | ||||
| }); | ||||
|  | ||||
| @ -1,5 +1,5 @@ | ||||
| <ul class="listing"> | ||||
|   {{#each items as |item|}} | ||||
|   {{#each itemsSorted as |item|}} | ||||
|   <li> | ||||
|     {{#if item.isFolder}} | ||||
|       {{#link-to "index" (query-params path=item.path)}} | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user