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

template becomes configurable, hide link if no href #323

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
5 changes: 4 additions & 1 deletion src/js/bootstrap-treeview.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@
checkedIcon: 'glyphicon glyphicon-check',
uncheckedIcon: 'glyphicon glyphicon-unchecked',

template: {},

color: undefined, // '#000000',
backColor: undefined, // '#FFFFFF',
borderColor: undefined, // '#dddddd',
Expand Down Expand Up @@ -159,6 +161,7 @@
delete options.data;
}
this.options = $.extend({}, _default.settings, options);
this.template = $.extend(this.template, this.options.template);

this.destroy();
this.subscribeEvents();
Expand Down Expand Up @@ -582,7 +585,7 @@
}

// Add text
if (_this.options.enableLinks) {
if (_this.options.enableLinks && node.href) {
// Add hyperlink
treeItem
.append($(_this.template.link)
Expand Down