         if docs?
             # sort by a triplet
             sortfn = (doc) -> [
-                meta.category_sortweight[doc.category] ? 0
-                meta.categories[doc.category].toLowerCase()
+                meta.categories[doc.category].weight ? 0
+                meta.categories[doc.category].name.toLowerCase()
                 doc.title?.toLowerCase() ? doc.id
             ]
             sdocs  = _.sortBy(docs, sortfn)

        cur_cat = undefined

        @state.sorted_docs.map (doc) =>
            if doc.category isnt cur_cat
                cur_cat         = doc.category
                cur_cat_title   = @state.metadata.categories[cur_cat]
                list.push(<li className="list-group-header" key={"header-#{cur_cat}"}>{cur_cat_title}</li>)

            list.push(

            path       : @props.library_selected.thumbnail

        img_style =
            display       : if @state.show_thumb then 'block' else 'none'
            maxHeight     : '100%'
            maxWidth      : '100%'
            border        : "1px solid #{COLORS.GRAY_L}"
            boxShadow     : "2px 2px 1px #{COLORS.GRAY_LL}"
            borderRadius  : '5px'

        return <img src={img_path} style={img_style} onLoad={=> @setState(show_thumb:true)} />

