Skip to content

Commit

Permalink
MINOR Don't follow <a> tag's href if click on page-icon or drag-icon …
Browse files Browse the repository at this point in the history
…(SSF-109)
  • Loading branch information
normann authored and chillu committed Feb 13, 2012
1 parent 21a185d commit 4bd526f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion admin/javascript/LeftAndMain.Content.js
Expand Up @@ -20,7 +20,12 @@
// Don't trigger unless coming from a click event.
// Avoids problems with automated section switches from tree to detail view
// when JSTree auto-selects elements on first load.
if(!origEvent) return false;
if(!origEvent) {
return false;
}else if($(origEvent.target).hasClass('jstree-icon') || $(origEvent.target).hasClass('jstree-pageicon')){
// in case the click is not on the node title, ie on pageicon or dragicon,
return false;
}

// Don't allow checking disabled nodes
if($(node).hasClass('disabled')) return false;
Expand Down
1 change: 1 addition & 0 deletions admin/javascript/LeftAndMain.Tree.js
Expand Up @@ -130,6 +130,7 @@
}

if($.inArray(data.func, ['check_node', 'uncheck_node'])) {
//Don't allow check and uncheck if parent is disabled
var node = $(data.args[0]).parents('li:first');
if(node.hasClass('disabled')) {
e.stopImmediatePropagation();
Expand Down

0 comments on commit 4bd526f

Please sign in to comment.