Skip to content

Commit 1178bb2

Browse files
authored
modifies JS library to facilitate selecting directories in addition to files (duracloud#178)
1 parent 6863f41 commit 1178bb2

1 file changed

Lines changed: 7 additions & 2 deletions

File tree

synctoolui/src/main/webapp/static/js/jqueryFileTree.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,12 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
6969
if (options.preventLinkAction) {
7070
event.preventDefault();
7171
}
72+
73+
jqft.container.find('li').removeClass('selected');
74+
7275
if ($ev.parent().hasClass('directory')) {
7376
if ($ev.parent().hasClass('collapsed')) {
77+
$ev.parent().addClass('selected');
7478
if (!options.multiFolder) {
7579
$ev.parent().parent().find('UL').slideUp({
7680
duration: options.collapseSpeed,
@@ -82,7 +86,8 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
8286
$ev.parent().find('UL').remove();
8387
return _this.showTree($ev.parent(), $ev.attr('rel'), function() {
8488
_this._trigger('filetreeexpanded', _this.data);
85-
return callback != null;
89+
// return callback != null;
90+
return typeof callback === "function" ? callback($ev.attr('rel')) : void 0;
8691
});
8792
} else {
8893
return $ev.parent().find('UL').slideUp({
@@ -100,7 +105,7 @@ var bind = function(fn, me){ return function(){ return fn.apply(me, arguments);
100105
}
101106
} else {
102107
if (!options.multiSelect) {
103-
jqft.container.find('li').removeClass('selected');
108+
// jqft.container.find('li').removeClass('selected');
104109
$ev.parent().addClass('selected');
105110
} else {
106111
if ($ev.parent().find('input').is(':checked')) {

0 commit comments

Comments
 (0)