From 329201885cd9640123357a292bd1c06865c2b3dd Mon Sep 17 00:00:00 2001 From: cj Date: Fri, 3 Jun 2016 00:04:02 +1000 Subject: [PATCH] Add Bootstrap style --- css/tree-control-attribute.css | 48 +++++++++++++++++++++++++++++++++ css/tree-control.css | 48 +++++++++++++++++++++++++++++++++ index.html | 49 ++++++++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+) diff --git a/css/tree-control-attribute.css b/css/tree-control-attribute.css index 1aea842..8a4fd41 100644 --- a/css/tree-control-attribute.css +++ b/css/tree-control-attribute.css @@ -107,3 +107,51 @@ [treecontrol].tree-dark { color: #ddd; } + +[treecontrol].tree-boot { + color: #428bca; + font-family: inherit; + font-size: inherit; +} + +[treecontrol].tree-boot > ul > li { + padding: 0; +} + +[treecontrol].tree-boot li > .tree-label { + display: block; + padding: 3px 0; + border-radius: 4px; +} + +[treecontrol].tree-boot i.tree-branch-head, +[treecontrol].tree-boot i.tree-leaf-head { + float: left; + height: 16px; + margin: 5px; +} + +[treecontrol].tree-boot li.tree-expanded i.tree-branch-head { + padding: 1px 10px; + background: url("../images/folder.png") no-repeat; +} + +[treecontrol].tree-boot li.tree-collapsed i.tree-branch-head { + padding: 1px 10px; + background: url("../images/folder-closed.png") no-repeat; +} + +[treecontrol].tree-boot li.tree-leaf i.tree-leaf-head { + padding: 1px 10px; + background: url("../images/file.png") no-repeat; +} + +[treecontrol].tree-boot .tree-label.tree-selected, +[treecontrol].tree-boot .tree-label.tree-selected:hover { + color: #fff; + background-color: #428bca; +} + +[treecontrol].tree-boot .tree-label:hover { + background-color: #eee; +} diff --git a/css/tree-control.css b/css/tree-control.css index 1e94505..58b6fd2 100644 --- a/css/tree-control.css +++ b/css/tree-control.css @@ -120,3 +120,51 @@ treecontrol.tree-dark li .tree-unselectable { treecontrol.tree-dark { color: #ddd; } + +treecontrol.tree-boot { + color: #428bca; + font-family: inherit; + font-size: inherit; +} + +treecontrol.tree-boot > ul > li { + padding: 0; +} + +treecontrol.tree-boot li > .tree-label { + display: block; + padding: 3px 0; + border-radius: 4px; +} + +treecontrol.tree-boot i.tree-branch-head, +treecontrol.tree-boot i.tree-leaf-head { + float: left; + height: 16px; + margin: 5px; +} + +treecontrol.tree-boot li.tree-expanded i.tree-branch-head { + padding: 1px 10px; + background: url("../images/folder.png") no-repeat; +} + +treecontrol.tree-boot li.tree-collapsed i.tree-branch-head { + padding: 1px 10px; + background: url("../images/folder-closed.png") no-repeat; +} + +treecontrol.tree-boot li.tree-leaf i.tree-leaf-head { + padding: 1px 10px; + background: url("../images/file.png") no-repeat; +} + +treecontrol.tree-boot .tree-label.tree-selected, +treecontrol.tree-boot .tree-label.tree-selected:hover { + color: #fff; + background-color: #428bca; +} + +treecontrol.tree-boot .tree-label:hover { + background-color: #eee; +} diff --git a/index.html b/index.html index 1eaae4a..e816839 100644 --- a/index.html +++ b/index.html @@ -755,6 +755,55 @@

Dark Style (Basic style, default configuration)

+
+ +
+
+
+
+
EXAMPLE:
+
+ +
+ + label: {{node.label}} ({{node.id}}) + +
+
+
+
+
+
+

Bootstrap style of the tree control, set using the class tree-boot. The style does not include the background color, instead, + inject your own background color using a wrapper div element.

+

Click on the folder icons to open and close the tree nodes. Click on the node label to select a node in the tree.

+

Selected node: {{selectedNode?selectedNode.label:"N/A"}}

+
+
+
+ + +

+            
+ +

+            
+
+
+ +
+