app/js/search.js
// Helper to create the HTML element for each search result
Helper to create the HTML element for each search result
Helper to create the HTML element for each search result
function createSearchResultListItem(node) {
    let resultNode = document.createElement("LI");
    resultNode.className = "list-group-item"; 
    let resultAnchor = document.createElement("A");
    resultAnchor.className = node.id;
    resultAnchor.appendChild(document.createTextNode(node.name));
    resultAnchor.oncontextmenu = function (event) { spawnContextMenu("search-result", event, node) };
    resultAnchor.ondblclick = function () {
        renderPage(node);
    }
    resultNode.appendChild(resultAnchor);
    return resultNode
}
function createSearchResultListItem ( node ) { let resultNode = document . createElement ( "LI" ) ; resultNode . className = "list-group-item" ; let resultAnchor = document . createElement ( "A" ) ; resultAnchor . className = node . id ; resultAnchor . appendChild ( document . createTextNode ( node . name ) ) ; resultAnchor . oncontextmenu = function ( event ) { spawnContextMenu ( "search-result" , event , node ) } ; resultAnchor . ondblclick = function ( ) { renderPage ( node ) ; } resultNode . appendChild ( resultAnchor ) ; return resultNode }
Helper to create the HTML element for each search result
Helper to create the HTML element for each search result
// for bootstrap // Result itself will be an anchor // Opens context menu on right click of workspace button