Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Added unselectAll function. #355

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion src/js/bootstrap-treeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,8 @@
selectNode: $.proxy(this.selectNode, this),
unselectNode: $.proxy(this.unselectNode, this),
toggleNodeSelected: $.proxy(this.toggleNodeSelected, this),

unselectAll: $.proxy(this.unselectAll, this),

// Expand / collapse methods
collapseAll: $.proxy(this.collapseAll, this),
collapseNode: $.proxy(this.collapseNode, this),
Expand Down Expand Up @@ -835,6 +836,18 @@
this.render();
};

/**
Unselect all tree nodes
@param {optional Object} options
*/
Tree.prototype.unselectAll = function (options) {
var identifiers = this.findNodes('true', 'g', 'state.selected');
this.forEachIdentifier(identifiers, options, $.proxy(function (node, options) {
this.setSelectedState(node, false, options);
}, this));

this.render();
};

/**
Collapse all tree nodes
Expand Down