* @param {element} e Event object
*/
navigation_tree.prototype.toggle_block_display = function(e) {
- YAHOO.util.Event.preventDefault(e);
if (e !== null) {
YAHOO.util.Event.stopPropagation(e);
}
this.tabpanel = null;
this.tabpanels = Array();
this.tabcount = 0;
+ this.preventhide = false;
this.showntab = null;
}
/**
var tabheight = parseInt(this.tabpanels[this.showntab.tabname].body.offsetHeight);
var tabtop = parseInt(this.tabpanels[this.showntab.tabname].cfg.getProperty('y'));
var titletop = YAHOO.util.Dom.getY(this.showntab.tabname+'_title');
-
+ var scrolltop = (document.all)?document.body.scrollTop:window.pageYOffset;
// This makes sure that the panel is the same height as the tab title to
// begin with
- if (tabtop > 10 && tabtop > titletop) {
- this.tabpanels[this.showntab.tabname].cfg.setProperty('y', titletop);
+ if (tabtop > (10+scrolltop) && tabtop > (titletop+scrolltop)) {
+ this.tabpanels[this.showntab.tabname].cfg.setProperty('y', titletop+scrolltop);
}
// This makes sure that if the panel is big it is moved up to ensure we don't
if (tabtop<10) {
tabtop = 10;
}
- this.tabpanels[this.showntab.tabname].cfg.setProperty('y', tabtop);
+ this.tabpanels[this.showntab.tabname].cfg.setProperty('y', tabtop+scrolltop);
}
// This makes the panel constrain to the screen's height if the panel is big
this.tabpanels[tabname].show(e, this.tabpanel);
YAHOO.util.Dom.addClass(tabname+'_title', 'active_tab');
YAHOO.util.Event.removeListener(tabname+'_sidebarpopup', "mouseover", this.show_tab);
- YAHOO.util.Event.addListener('navigation_tab_panel_'+tabname, "click", function (e){YAHOO.util.Event.stopPropagation(e);});
+ YAHOO.util.Event.addListener('navigation_tab_panel_'+tabname, "click", function (e){this.preventhide = true}, this, true);
YAHOO.util.Event.addListener(tabname+'_sidebarpopup', "click", this.hide_tab, tabname, this);
YAHOO.util.Event.addListener(window, 'resize', this.resize_tab, this, true);
YAHOO.util.Event.addListener(document.body, "click", this.hide_tab, tabname, this);
* @return {bool}
*/
navigation_tab_panel.prototype.hide_tab = function(e, tabname) {
+ if (this.preventhide===true) {
+ this.preventhide = false;
+ return true;
+ }
this.showntab = null;
YAHOO.util.Event.addListener(tabname+'_sidebarpopup', "mouseover", this.show_tab, tabname, this);
YAHOO.util.Event.removeListener(window, 'resize', this.resize_tab);