diff options
| author | Horus3 | 2014-02-24 16:42:14 +0100 |
|---|---|---|
| committer | Horus3 | 2014-02-24 16:42:14 +0100 |
| commit | 06f945f27840b53e57795dadbc38e76f7e11ab1c (patch) | |
| tree | 689d5c7f4ffa15460c7e90f47c6a7dd59ce4e8bd /zend/documentation/api/core/js/sidebar.js | |
| download | random-06f945f27840b53e57795dadbc38e76f7e11ab1c.tar.gz | |
init
Diffstat (limited to 'zend/documentation/api/core/js/sidebar.js')
| -rw-r--r-- | zend/documentation/api/core/js/sidebar.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/zend/documentation/api/core/js/sidebar.js b/zend/documentation/api/core/js/sidebar.js new file mode 100644 index 0000000..e9096ff --- /dev/null +++ b/zend/documentation/api/core/js/sidebar.js @@ -0,0 +1,45 @@ +jQuery.expr[':'].Contains = function(a, i, m) { + return jQuery(a).text().toUpperCase().indexOf(m[3].toUpperCase()) >= 0; +}; + +$(function() { + $("#sidebar-nav").accordion({ + autoHeight: false, + navigation: true, + collapsible: true + }).accordion("activate", false) + .find('a.link').unbind('click').click( + function(ev) { + ev.cancelBubble = true; // IE + if (ev.stopPropagation) { + ev.stopPropagation(); // the rest + } + + return true; + }).prev().prev().remove(); + + $("#sidebar-nav>h3").click(function() { + if ($(this).attr('initialized') == 'true') return; + + $(this).next().find(".sidebar-nav-tree").treeview({ + collapsed: true, + persist: "cookie" + }); + $(this).attr('initialized', true); + }); +}); + +function tree_search(input) { + treeview = $(input).parent().parent().next(); + + // Expand all items + treeview.find('.expandable-hitarea').click(); + + // make all items visible again + treeview.find('li:hidden').show(); + + // hide all items that do not match the given search criteria + if ($(input).val()) { + treeview.find('li').not(':has(a:Contains(' + $(input).val() + '))').hide(); + } +} |
