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

Added <span class='node-text'> tag surrounding node text #354

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
24 changes: 12 additions & 12 deletions src/js/bootstrap-treeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,20 +321,20 @@
var target = $(event.target);
var node = this.findNode(target);
if (!node || node.state.disabled) return;

var classList = target.attr('class') ? target.attr('class').split(' ') : [];
if ((classList.indexOf('expand-icon') !== -1)) {

this.toggleExpandedState(node, _default.options);
this.render();
}
else if ((classList.indexOf('check-icon') !== -1)) {

this.toggleCheckedState(node, _default.options);
this.render();
}
else {

if (node.selectable) {
this.toggleSelectedState(node, _default.options);
} else {
Expand Down Expand Up @@ -516,7 +516,7 @@
.addClass(node.state.checked ? 'node-checked' : '')
.addClass(node.state.disabled ? 'node-disabled': '')
.addClass(node.state.selected ? 'node-selected' : '')
.addClass(node.searchResult ? 'search-result' : '')
.addClass(node.searchResult ? 'search-result' : '')
.attr('data-nodeid', node.nodeId)
.attr('style', _this.buildStyleOverride(node));

Expand Down Expand Up @@ -548,13 +548,13 @@

// Add node icon
if (_this.options.showIcon) {

var classList = ['node-icon'];

classList.push(node.icon || _this.options.nodeIcon);
if (node.state.selected) {
classList.pop();
classList.push(node.selectedIcon || _this.options.selectedIcon ||
classList.push(node.selectedIcon || _this.options.selectedIcon ||
node.icon || _this.options.nodeIcon);
}

Expand All @@ -569,7 +569,7 @@

var classList = ['check-icon'];
if (node.state.checked) {
classList.push(_this.options.checkedIcon);
classList.push(_this.options.checkedIcon);
}
else {
classList.push(_this.options.uncheckedIcon);
Expand All @@ -593,7 +593,7 @@
else {
// otherwise just text
treeItem
.append(node.text);
.append("<span class='node-text'>" + node.text + "</span>");
}

// Add tags as badges
Expand Down Expand Up @@ -935,7 +935,7 @@
this.forEachIdentifier(identifiers, options, $.proxy(function (node, options) {
this.toggleExpandedState(node, options);
}, this));

this.render();
};

Expand Down Expand Up @@ -1085,7 +1085,7 @@

$.each(identifiers, $.proxy(function (index, identifier) {
callback(this.identifyNode(identifier), options);
}, this));
}, this));
};

/*
Expand Down Expand Up @@ -1156,9 +1156,9 @@
});

if (options.render) {
this.render();
this.render();
}

this.$element.trigger('searchCleared', $.extend(true, {}, results));
};

Expand Down