Skip to content

Commit

Permalink
navigation MDL-25317 Fixed scroll issue and ajax expansion bug within…
Browse files Browse the repository at this point in the history
… the navigation JS
  • Loading branch information
Sam Hemelryk committed Nov 19, 2010
1 parent 134d38f commit a467d24
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
5 changes: 5 additions & 0 deletions blocks/dock.js
Original file line number Diff line number Diff line change
Expand Up @@ -627,6 +627,7 @@ M.core_dock.resize = function() {
var titletop = item.nodes.docktitle.getY()-docky-buffer;
var containery = this.nodes.container.getY();
var containerheight = containery-docky+this.nodes.buttons.get('offsetHeight');
var scrolltop = panel.contentBody.get('scrollTop');
panel.contentBody.setStyle('height', 'auto');
panel.removeClass('oversized_content');
var panelheight = panel.get('offsetHeight');
Expand All @@ -643,6 +644,10 @@ M.core_dock.resize = function() {
} else {
panel.setTop(titletop-containerheight+buffer);
}

if (scrolltop) {
panel.contentBody.set('scrollTop', scrolltop);
}
}

if (this.cfg.position=='right') {
Expand Down
10 changes: 7 additions & 3 deletions blocks/navigation/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,11 @@ M.block_navigation.classes.tree = function(Y, id, properties) {
*/
M.block_navigation.classes.tree.prototype.init_load_ajax = function(e, branch) {
e.stopPropagation();
if (e.target.get('nodeName').toUpperCase() != 'P') {
var target = e.target;
if (target.test('span')) {
target = target.ancestor('p');
}
if (!target || !target.test('p')) {
return true;
}
var cfginstance = '', Y = this.Y;
Expand All @@ -150,11 +154,11 @@ M.block_navigation.classes.tree.prototype.init_load_ajax = function(e, branch) {
data:'elementid='+branch.id+'&id='+branch.branchid+'&type='+branch.type+'&sesskey='+M.cfg.sesskey+cfginstance,
on: {
complete:this.load_ajax,
success:function() {Y.detach('click', this.init_load_ajax, e.target);}
success:function() {Y.detach('click', this.init_load_ajax, target);}
},
context:this,
arguments:{
target:e.target
target:target
}
});
return true;
Expand Down

0 comments on commit a467d24

Please sign in to comment.