Merge pull request #61 from alDuncanson/flamelinkCollectionOrder
Reordering the collection entries works now.
This commit is contained in:
		
						commit
						c3974fe5ea
					
				@ -6,7 +6,6 @@ class FlameLinkCollection extends Component {
 | 
				
			|||||||
    constructor() {
 | 
					    constructor() {
 | 
				
			||||||
        super();
 | 
					        super();
 | 
				
			||||||
        
 | 
					        
 | 
				
			||||||
        global.mediaID = '';
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
        this.state = {
 | 
					        this.state = {
 | 
				
			||||||
          schemaContent: '',
 | 
					          schemaContent: '',
 | 
				
			||||||
@ -22,7 +21,7 @@ class FlameLinkCollection extends Component {
 | 
				
			|||||||
        var arr2 = [];
 | 
					        var arr2 = [];
 | 
				
			||||||
        var collectionInfo = [schemaData, this.state.schemaContent];
 | 
					        var collectionInfo = [schemaData, this.state.schemaContent];
 | 
				
			||||||
        for (var val in this.state.schemaContent){
 | 
					        for (var val in this.state.schemaContent){
 | 
				
			||||||
            arr2.push(val);
 | 
					            arr2[this.state.schemaContent[val]['order']] = val;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        return arr2.map(this.getCollectionComponentInfo, collectionInfo);
 | 
					        return arr2.map(this.getCollectionComponentInfo, collectionInfo);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
@ -35,6 +34,17 @@ class FlameLinkCollection extends Component {
 | 
				
			|||||||
        return <FlameLinkCollectionComponentCreations schemaData={this[0]} schemaContent={this[1][num]} arr={arr3} key={num} />
 | 
					        return <FlameLinkCollectionComponentCreations schemaData={this[0]} schemaContent={this[1][num]} arr={arr3} key={num} />
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    countProperties(obj) {
 | 
				
			||||||
 | 
					    var count = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    for(var prop in obj) {
 | 
				
			||||||
 | 
					        if(obj.hasOwnProperty(prop))
 | 
				
			||||||
 | 
					            ++count;
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    return count;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    render() {
 | 
					    render() {
 | 
				
			||||||
        return(
 | 
					        return(
 | 
				
			||||||
            <div>
 | 
					            <div>
 | 
				
			||||||
 | 
				
			|||||||
@ -103,11 +103,6 @@ class FlameLinkCollectionStructure extends Component {
 | 
				
			|||||||
                    return <FlameLinkFieldSet field={content[key]} field2={field.options}/>
 | 
					                    return <FlameLinkFieldSet field={content[key]} field2={field.options}/>
 | 
				
			||||||
                }
 | 
					                }
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        console.log('Content: ', content)
 | 
					 | 
				
			||||||
        console.log('Field: ', field)
 | 
					 | 
				
			||||||
        console.log('Key: ', key)
 | 
					 | 
				
			||||||
        console.log('Type: ', type)
 | 
					 | 
				
			||||||
        console.log('Description: ', description)
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    render() {
 | 
					    render() {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user