Permalink
Browse files

Tree: Hide chervron for folder that doesn't have children #860

Selected background changed

Selected background changed
  • Loading branch information...
1 parent 25b28a0 commit 91169762ea82975a227c42443bd5b9773a3f913c @cmcculloh cmcculloh committed with BenjaminNeilDavis Nov 26, 2014
Showing with 68 additions and 5 deletions.
  1. +57 −1 data.js
  2. +6 −3 js/checkbox.js
  3. +5 −1 less/tree.less
View
@@ -704,7 +704,63 @@
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;
View
@@ -50,6 +50,7 @@
// handle events
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
this.setState();
@@ -107,10 +108,12 @@
return this.state.checked;
},
- toggle: function() {
- this.state.checked = !this.state.checked;
+ toggle: function(e) {
+ if (!e || e.currentTarget === e.originalEvent.target) {
+ this.state.checked = !this.state.checked;
- this._toggleCheckedState();
+ this._toggleCheckedState();
+ }
},
toggleContainer: function(){
View
@@ -38,7 +38,6 @@
-ms-transform:rotate(90deg);
-webkit-transform:rotate(90deg);
position: relative;
- left: -5px;
}
[data-children=false] > .tree-branch-header .icon-caret:before {
@@ -86,6 +85,11 @@
.tree-branch-children {
margin-left: 14px;
}
+ &[haschildren='false'] {
+ .icon-caret {
+ visibility: hidden;
+ }
+ }
}

0 comments on commit 9116976

Please sign in to comment.