this.cachedcontent = null;
this.cachedfooter = null;
this.position = 'block';
+ this.skipsetposition = false;
this.togglesidetabdisplay = '[[togglesidetabdisplay]]';
this.toggleblockdisplay = '[[toggleblockdisplay]]';
this.sideblockwidth = null;
}
for (i = 0; i<this.expansions.length; i++) {
try {
+ this.expansions[i].element = document.getElementById(this.expansions[i].id);
YAHOO.util.Event.addListener(this.expansions[i].id, 'click', this.init_load_ajax, this.expansions[i], this);
} catch (err) {
this.errorlog += "attaching ajax load events: \t"+err+"\n";
if (YAHOO.util.Dom.hasClass(e, 'sideblock_js_sidebarpopout')) {
YAHOO.util.Dom.removeClass(e, 'sideblock_js_sidebarpopout');
+ this.skipsetposition = true;
this.toggle_block_display(e, this);
} else if (YAHOO.util.Dom.hasClass(e, 'sideblock_js_expansion')) {
YAHOO.util.Event.addListener(e, 'mouseover', this.togglesize, e, this);
var branch = outcome.responseXML.documentElement;
if (branch!=null && this.add_branch(branch,outcome.argument.target ,1)) {
// If we get here everything worked perfectly
- YAHOO.util.Event.removeListener(outcome.argument.branch.id, 'click', this.init_load_ajax);
+ YAHOO.util.Event.removeListener(outcome.argument.branch.element, 'click', navigation_tree.prototype.init_load_ajax);
if (this.position === 'sidebar') {
YAHOO.moodle.navigation.tabpanel.resize_tab();
}
YAHOO.moodle.navigation.tabpanel = new navigation_tab_panel();
}
YAHOO.moodle.navigation.tabpanel.add_to_tab_panel(this.name, tabtitle, tabcontent, tabcommands);
- set_user_preference('nav_in_tab_panel_'+this.name, 1);
+ if (!this.skipsetposition) {
+ set_user_preference('nav_in_tab_panel_'+this.name, 1);
+ } else {
+ this.skipsetposition = false;
+ }
return true;
}
/**
YAHOO.util.Dom.addClass(branchli, 'collapsed');
YAHOO.util.Event.addListener(branchp, 'click', gntinstance.toggleexpansion, this, gntinstance);
if (this.myexpandable) {
- YAHOO.util.Event.addListener(branchp, 'click', gntinstance.init_load_ajax, {branchid:this.mykey,id:this.myid,type:this.mytype}, gntinstance);
+ YAHOO.util.Event.addListener(branchp, 'click', gntinstance.init_load_ajax, {branchid:this.mykey,id:this.myid,type:this.mytype,element:branchp}, gntinstance);
}
}
if (this.myclass != null) {