Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Commit

Permalink
Tree: Hide chervron for folder that doesn't have children #860
Browse files Browse the repository at this point in the history
Selected background changed

Selected background changed
  • Loading branch information
cmcculloh authored and BenjaminNeilDavis committed Nov 26, 2014
1 parent 25b28a0 commit 9116976
Show file tree
Hide file tree
Showing 3 changed files with 68 additions and 5 deletions.
58 changes: 57 additions & 1 deletion data.js
Expand Up @@ -704,7 +704,63 @@
sound: '???' sound: '???'
} }
] ]
} },
tree: [
{
"name": "Aquire",
"type": "folder",
"dataAttributes": { "id": "aquire-folder" },
"children": [
{
"name": "POS Receipt",
"type": "item"
},
{
"name": "Confirm Subscription",
"type": "item"
},
{
"name": "Thanks for Signing Up",
"type": "item"
}
]
},
{
"name": "Onboard",
"type": "folder"
},
{
"name": "Engage",
"type": "folder",
"dataAttributes": { "id": "engage-folder" },
"children":[
{
"name": "Abandoned Cart",
"type": "folder",
"children": [
{
"name": "Archive",
"type": "folder"
}
]
},
{
"name": "Transactional",
"type": "folder",
"children": [
{
"name": "Archive",
"type": "folder"
}
]
}
]
},
{
"name": "Retain",
"type": "folder"
}
]
}; };


window.data = data; window.data = data;
Expand Down
9 changes: 6 additions & 3 deletions js/checkbox.js
Expand Up @@ -50,6 +50,7 @@


// handle events // handle events
this.$element.on('change.fu.checkbox', $.proxy( this.itemchecked, this )); this.$element.on('change.fu.checkbox', $.proxy( this.itemchecked, this ));
this.$label.on('click', $.proxy(this.toggle, this));//make repeated label clicks work


// set default state // set default state
this.setState(); this.setState();
Expand Down Expand Up @@ -107,10 +108,12 @@
return this.state.checked; return this.state.checked;
}, },


toggle: function() { toggle: function(e) {
this.state.checked = !this.state.checked; if (!e || e.currentTarget === e.originalEvent.target) {
this.state.checked = !this.state.checked;


this._toggleCheckedState(); this._toggleCheckedState();
}
}, },


toggleContainer: function(){ toggleContainer: function(){
Expand Down
6 changes: 5 additions & 1 deletion less/tree.less
Expand Up @@ -38,7 +38,6 @@
-ms-transform:rotate(90deg); -ms-transform:rotate(90deg);
-webkit-transform:rotate(90deg); -webkit-transform:rotate(90deg);
position: relative; position: relative;
left: -5px;
} }


[data-children=false] > .tree-branch-header .icon-caret:before { [data-children=false] > .tree-branch-header .icon-caret:before {
Expand Down Expand Up @@ -86,6 +85,11 @@
.tree-branch-children { .tree-branch-children {
margin-left: 14px; margin-left: 14px;
} }
&[haschildren='false'] {
.icon-caret {
visibility: hidden;
}
}


} }


Expand Down

0 comments on commit 9116976

Please sign in to comment.