MINOR Don't follow <a> tag's href if click on page-icon or drag-icon (SSF-109)

This commit is contained in:
Normann Lou 2012-02-08 19:19:32 +13:00 committed by Ingo Schommer
parent 21a185dfa9
commit 4bd526fbee
2 changed files with 7 additions and 1 deletions

View File

@ -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;

View File

@ -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();