72853428212949dd7ddcb4824762b8c85827461a braney Mon Sep 18 13:47:27 2017 -0700 custom icons for tracks and such diff --git src/hg/js/hgCollection.js src/hg/js/hgCollection.js index 4e95edb..68b1ac3 100644 --- src/hg/js/hgCollection.js +++ src/hg/js/hgCollection.js @@ -83,48 +83,49 @@ var ourCalcName = getUniqueName("calc"); var newName = "Calc Track"; var newDescription = "Description of Calculated Track"; var parent = $(selectedTree).find("li").first(); var newId = $(selectedTree).jstree("create_node", parent, newName + " (" + newDescription + ")"); var newNode = $(selectedTree).jstree("get_node", newId); newNode.li_attr.class = "folder"; newNode.li_attr.name = ourCalcName; newNode.li_attr.shortlabel = newName; newNode.li_attr.longlabel = newDescription; newNode.li_attr.visibility = "full"; newNode.li_attr.color = "#0"; newNode.li_attr.viewfunc = "add all"; newNode.li_attr.viewtype = "view"; + $(selectedTree).jstree("set_icon", newNode, '../images/folderC.png'); } function newCollection() { // called when the "New Collection" button is pressed var ourCollectionName = getUniqueName("coll"); var ourTreeName = getUniqueName("tree"); var newName = "A New Collection"; var newDescription = "Description of New Collection"; var attributes = "shortLabel='" + newName + "' "; attributes += "longLabel='" + newDescription + "' "; attributes += "color='" + "#0" + "' "; attributes += "viewType='" + "track" + "' "; attributes += "visibility='" + "full" + "' "; attributes += "name='" + ourCollectionName + "' "; attributes += "class='" + "folder" + "' "; $('#collectionList').append("<li " + attributes + "id='"+ourCollectionName+"'>A New Collection</li>"); - $('#currentCollection').append("<div id='"+ourTreeName+"'><ul><li " + attributes+ ">A New Collection</li><ul></div>"); + $('#currentCollection').append("<div id='"+ourTreeName+"'><ul><li data-jstree='{\"icon\":\"../images/folderC.png\"}' " + attributes+ ">A New Collection</li><ul></div>"); var newTree = $('#currentCollection div:last'); trees[ourCollectionName] = newTree; $(newTree).jstree({ "core" : { "check_callback" : checkCallback }, 'plugins' : ['dnd', 'conditionalselect', 'contextmenu'], 'check_callback' : checkCallback, 'contextmenu': { "items" : currentCollectionItems}, 'dnd': {check_while_dragging: true} }); $(newTree).on("select_node.jstree", selectTreeNode); var lastElement = $("#collectionList li").last(); //lastElement.addClass("folder"); selectElements($("#collectionList"), lastElement) ;