-
Notifications
You must be signed in to change notification settings - Fork 13
/
table-row.js
52 lines (44 loc) · 995 Bytes
/
table-row.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import Ember from 'ember';
import layout from '../templates/components/table-row';
export default Ember.Component.extend({
layout,
tagName: 'tr',
/**
If this row should render
@public
*/
shouldRender: false,
_shouldRender: false,
show() {
if (this._shouldRender) {
return;
}
this.set('shouldRender', true);
this._shouldRender = true;
},
hide() {
if (!this._shouldRender) {
return;
}
this.set('shouldRender', false);
this._shouldRender = false;
},
willInsertElement() {
this._super(...arguments);
// TODO: clean up
this.element.style.height = this.get('rowHeight.string').replace(/height:\s*/, '');
},
willDestroyElement() {
this._super(...arguments);
this.set('shouldRender', false);
this._shouldRender = false;
this.unregister(this);
},
init() {
this._super(...arguments);
this.register(this);
if (!this.get('content.isParent')) {
this.show();
}
}
});