diff options
author | Dimitri van Heesch <dimitri@stack.nl> | 2016-05-01 08:05:39 (GMT) |
---|---|---|
committer | Dimitri van Heesch <dimitri@stack.nl> | 2016-05-05 19:40:39 (GMT) |
commit | 8480d35beef57ed08139b58972bfb83a3b37422c (patch) | |
tree | 13d486ed244ee6382a88d5d3312f0ea01b5131be /templates/html/menu.js | |
parent | 33915cdce6b66af7e0f8d3e98d741df6e9cc5e32 (diff) | |
download | Doxygen-8480d35beef57ed08139b58972bfb83a3b37422c.zip Doxygen-8480d35beef57ed08139b58972bfb83a3b37422c.tar.gz Doxygen-8480d35beef57ed08139b58972bfb83a3b37422c.tar.bz2 |
Applied responsive design to menu bar using smartmenus
Diffstat (limited to 'templates/html/menu.js')
-rw-r--r-- | templates/html/menu.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/templates/html/menu.js b/templates/html/menu.js new file mode 100644 index 0000000..8ea4097 --- /dev/null +++ b/templates/html/menu.js @@ -0,0 +1,22 @@ +function initMenu(relPath,searchEnabled,search) { + function makeTree(data,relPath) { + var result=''; + if ('children' in data) { + result+='<ul>'; + for (var i in data.children) { + result+='<li><a href="'+relPath+data.children[i].url+'">'+ + data.children[i].text+'</a>'+ + makeTree(data.children[i],relPath)+'</li>'; + } + result+='</ul>'; + } + return result; + } + + $('#main-nav').append(makeTree(menudata,relPath)); + $('#main-nav').children(':first').addClass('sm sm-dox').attr('id','main-menu'); + if (searchEnabled) { + $('#main-menu').append('<li style="float:right"><div id="MSearchBox" class="MSearchBoxInactive"><span class="left"><img id="MSearchSelect" src="'+relPath+'search/mag_sel.png" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()" alt=""/><input type="text" id="MSearchField" value="'+search+'" accesskey="S" onfocus="searchBox.OnSearchFieldFocus(true)" onblur="searchBox.OnSearchFieldFocus(false)" onkeyup="searchBox.OnSearchFieldChange(event)"/></span><span class="right"><a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="'+relPath+'search/close.png" alt=""/></a></span></div></li>'); + } + $('#main-menu').smartmenus(); +} |