From 997c0b01fda22f8b5458df2a3aa666fe59a6d89a Mon Sep 17 00:00:00 2001 From: Julie Valet Date: Thu, 7 Dec 2017 12:01:50 -0500 Subject: [PATCH 1/4] Remove link when tree_icon is void --- src/tree-grid-directive.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tree-grid-directive.js b/src/tree-grid-directive.js index 08d514b..bbb2143 100644 --- a/src/tree-grid-directive.js +++ b/src/tree-grid-directive.js @@ -16,7 +16,7 @@ " \n" + " \n" + - " " + @@ -72,7 +72,7 @@ '$timeout', 'treegridTemplate', function ($timeout, - treegridTemplate) { + treegridTemplate) { return { restrict: 'E', From 37da0272c964aa5847ce7065c6a02e3e4345b3e8 Mon Sep 17 00:00:00 2001 From: Julie Valet Date: Thu, 7 Dec 2017 12:18:01 -0500 Subject: [PATCH 2/4] Add root icon for dynamic expand --- src/tree-grid-directive.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/tree-grid-directive.js b/src/tree-grid-directive.js index bbb2143..b7d6553 100644 --- a/src/tree-grid-directive.js +++ b/src/tree-grid-directive.js @@ -102,6 +102,7 @@ attrs.iconExpand = attrs.iconExpand ? attrs.iconExpand : 'icon-plus glyphicon glyphicon-plus fa fa-plus'; attrs.iconCollapse = attrs.iconCollapse ? attrs.iconCollapse : 'icon-minus glyphicon glyphicon-minus fa fa-minus'; attrs.iconLeaf = attrs.iconLeaf ? attrs.iconLeaf : 'icon-file glyphicon glyphicon-file fa fa-file'; + attrs.iconRoot = attrs.iconRoot ? attrs.iconRoot : ''; attrs.sortedAsc = attrs.sortedAsc ? attrs.sortedAsc : 'icon-file glyphicon glyphicon-chevron-up fa angle-up'; attrs.sortedDesc = attrs.sortedDesc ? attrs.sortedDesc : 'icon-file glyphicon glyphicon-chevron-down fa angle-down'; attrs.expandLevel = attrs.expandLevel ? attrs.expandLevel : '0'; @@ -371,7 +372,11 @@ branch.expanded = false; } if (!branch.children || branch.children.length === 0) { - tree_icon = branch.icons && branch.icons.iconLeaf || attrs.iconLeaf; + if ((branch.icons && branch.icons.iconRoot || attrs.iconRoot) && branch.parent_uid == null) { + tree_icon = branch.icons && branch.icons.iconRoot || attrs.iconRoot; + } else { + tree_icon = branch.icons && branch.icons.iconLeaf || attrs.iconLeaf; + } } else { if (branch.expanded) { tree_icon = branch.icons && branch.icons.iconCollapse || attrs.iconCollapse; From 4d5b54e10ca43bdee89cb025477f325ebd8fa675 Mon Sep 17 00:00:00 2001 From: Julie Valet Date: Wed, 13 Dec 2017 12:29:16 -0500 Subject: [PATCH 3/4] Fix sorting icon name for font awesome --- src/tree-grid-directive.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tree-grid-directive.js b/src/tree-grid-directive.js index b7d6553..003da62 100644 --- a/src/tree-grid-directive.js +++ b/src/tree-grid-directive.js @@ -103,8 +103,8 @@ attrs.iconCollapse = attrs.iconCollapse ? attrs.iconCollapse : 'icon-minus glyphicon glyphicon-minus fa fa-minus'; attrs.iconLeaf = attrs.iconLeaf ? attrs.iconLeaf : 'icon-file glyphicon glyphicon-file fa fa-file'; attrs.iconRoot = attrs.iconRoot ? attrs.iconRoot : ''; - attrs.sortedAsc = attrs.sortedAsc ? attrs.sortedAsc : 'icon-file glyphicon glyphicon-chevron-up fa angle-up'; - attrs.sortedDesc = attrs.sortedDesc ? attrs.sortedDesc : 'icon-file glyphicon glyphicon-chevron-down fa angle-down'; + attrs.sortedAsc = attrs.sortedAsc ? attrs.sortedAsc : 'icon-file glyphicon glyphicon-chevron-up fa fa-angle-up'; + attrs.sortedDesc = attrs.sortedDesc ? attrs.sortedDesc : 'icon-file glyphicon glyphicon-chevron-down fa fa-angle-down'; attrs.expandLevel = attrs.expandLevel ? attrs.expandLevel : '0'; expand_level = parseInt(attrs.expandLevel, 10); From 7b80f8f10a290962688bc76850f37bd5645e8c1f Mon Sep 17 00:00:00 2001 From: Julie Valet Date: Wed, 13 Dec 2017 12:51:06 -0500 Subject: [PATCH 4/4] Fix reset sorting on expandingProperty --- src/tree-grid-directive.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/tree-grid-directive.js b/src/tree-grid-directive.js index 003da62..18a02e6 100644 --- a/src/tree-grid-directive.js +++ b/src/tree-grid-directive.js @@ -283,6 +283,11 @@ col.sortDirection = "none"; } } + // Reset sorting on expanding column + if (scope.expandingProperty && scope.expandingProperty.field != sortedCol.field) { + scope.expandingProperty.sorted = false; + scope.expandingProperty.sortDirection = 'none'; + } } /* end of sorting methods */