Skip to content
Browse files

Search box click will navigate to private/protected/deprecated items …

…if the category is visible.
  • Loading branch information...
1 parent f23a64b commit b9ad441a3572c68d43ac770b64bf946dc6ccbd43 Adam Moore committed Nov 11, 2008
Showing with 20 additions and 3 deletions.
  1. +20 −3 template/assets/ac-js
View
23 template/assets/ac-js
@@ -35,21 +35,38 @@ Event.onAvailable('yui-classopts-form', function() {
var checkCookie = function(id) {
var value = YAHOO.util.Cookie.getSub('yuidoc', id),
- el = Dom.get(id);
+ el = Dom.get(id), checked = (value === 'checked');;
+
+ /*
if (value === 'checked') {
el.checked = true;
} else {
el.checked = false;
}
+ */
+
+ el.checked = checked;
+ return checked;
};
- var els = ['show_deprecated', 'show_protected', 'show_private'];
+ var els = ['show_deprecated', 'show_protected', 'show_private'],
+ reapplyHash = false;
for (var i = 0; i < els.length; i++) {
Event.on(els[i], 'click', handleClick);
- checkCookie(els[i]);
+ reapplyHash = checkCookie(els[i]) || reapplyHash;
handleClick(els[i]);
}
+
+ // If we dynamically show private/protected/etc items during
+ // load, we need to reapply anchors so that the search feature
+ // works correctly for items that are initially hidden.
+ if (reapplyHash) {
+ var dl = document.location, hash = dl.hash;
+ if (hash) {
+ dl.hash = hash;
+ }
+ }
});

0 comments on commit b9ad441

Please sign in to comment.
Something went wrong with that request. Please try again.