Skip to content

Commit 87f1f2a

Browse files
committed
Update dependencies
1 parent ace3ef2 commit 87f1f2a

File tree

6 files changed

+640
-1221
lines changed

6 files changed

+640
-1221
lines changed

.ember-cli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,5 @@
55

66
Setting `disableAnalytics` to true will prevent any data from being sent.
77
*/
8-
"disableAnalytics": false
8+
"disableAnalytics": true
99
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ The model requires specific properties to properly function:
142142
- `children` - `array` of other nodes
143143
- `isChecked` - `boolean` used for checkbox state
144144
- `isExpanded` - `boolean` used to expand a node (children)
145-
- `isIndeterminate` - `boolean` used for checkbox "indeterminate" display
145+
- `isIndeterminate` - `boolean` used for checkbox "indeterminate" state
146146
- `isSelected` - `boolean` optionally used for hover state
147147
- `isVisible` - `boolean` used to display or hide a node
148148

addon/components/x-tree-children.js

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,22 +13,16 @@ export default Component.extend({
1313
let children = model.get('children');
1414

1515
if (children.length) {
16+
let isChecked = false;
17+
let isIndeterminate = false;
18+
1619
if (children.every(x => x.isChecked)) {
17-
model.setProperties({
18-
isChecked: true,
19-
isIndeterminate: false
20-
});
20+
isChecked = true;
2121
} else if (children.some(x => x.isChecked || x.isIndeterminate)) {
22-
model.setProperties({
23-
isChecked: false,
24-
isIndeterminate: true
25-
});
26-
} else {
27-
model.setProperties({
28-
isChecked: false,
29-
isIndeterminate: false
30-
});
22+
isIndeterminate = true;
3123
}
24+
25+
model.setProperties({ isChecked, isIndeterminate });
3226
}
3327

3428
this.sendAction('updateCheckbox');

addon/components/x-tree-node.js

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,27 +6,31 @@ export default Component.extend({
66
layout,
77
classNameBindings: ['model.isSelected:tree-highlight', 'isChosen:tree-chosen'],
88

9+
recursiveCheck: false,
10+
911
isChosen: computed('model.id', 'chosenId', function() {
1012
return this.get('model.id') === this.get('chosenId');
1113
}),
1214

13-
recursiveCheck: false,
14-
1515
click() {
1616
let select = this.get('onSelect');
1717
if (select) {
18-
let wasChecked = this.get('model.isChecked');
19-
select(this.get('model'));
20-
let isChecked = this.get('model.isChecked');
18+
let model = this.get('model');
19+
let wasChecked = model.get('isChecked');
20+
21+
select(model);
22+
23+
let isChecked = model.get('isChecked');
2124
if (isChecked !== wasChecked && this.get('recursiveCheck')) {
22-
this.setChildCheckboxesRecursively(this.get('model'), isChecked);
25+
this.setChildCheckboxesRecursively(model, isChecked);
2326
this.updateCheckbox();
2427
}
2528
}
2629
},
2730

2831
mouseEnter() {
2932
this.set('model.isSelected', true);
33+
3034
let hover = this.get('onHover');
3135
if (hover) {
3236
hover(this.get('model'));
@@ -35,6 +39,7 @@ export default Component.extend({
3539

3640
mouseLeave() {
3741
this.set('model.isSelected', false);
42+
3843
let hoverOut = this.get('onHoverOut');
3944
if (hoverOut) {
4045
hoverOut(this.get('model'));
@@ -49,6 +54,7 @@ export default Component.extend({
4954
isChecked,
5055
isIndeterminate: false
5156
});
57+
5258
this.setChildCheckboxesRecursively(child, isChecked);
5359
});
5460
}
@@ -57,16 +63,18 @@ export default Component.extend({
5763
actions: {
5864
toggleCheck(event) {
5965
event.stopPropagation();
60-
this.toggleProperty('model.isChecked');
66+
67+
let isChecked = this.toggleProperty('model.isChecked');
68+
let model = this.get('model');
69+
6170
if (this.get('recursiveCheck')) {
62-
let isChecked = this.get('model.isChecked');
63-
this.setChildCheckboxesRecursively(this.model, isChecked);
71+
this.setChildCheckboxesRecursively(model, isChecked);
6472
this.updateCheckbox();
6573
}
6674

6775
let check = this.get('onCheck');
6876
if (check) {
69-
check(this.get('model'));
77+
check(model);
7078
}
7179
},
7280

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"test:all": "ember try:each"
2424
},
2525
"dependencies": {
26-
"ember-cli-babel": "^6.16.0",
26+
"ember-cli-babel": "^6.17.0",
2727
"ember-cli-htmlbars": "^3.0.0"
2828
},
2929
"devDependencies": {
@@ -36,9 +36,9 @@
3636
"ember-load-initializers": "^1.1.0",
3737
"ember-maybe-import-regenerator": "^0.1.6",
3838
"ember-resolver": "^5.0.1",
39-
"ember-source": "~3.3.1",
39+
"ember-source": "~3.4.0",
4040
"ember-source-channel-url": "^1.1.0",
41-
"ember-try": "^0.2.23",
41+
"ember-try": "^1.0.0",
4242
"eslint-plugin-ember": "^5.2.0",
4343
"eslint-plugin-node": "^7.0.1",
4444
"loader.js": "^4.7.0"

0 commit comments

Comments
 (0)