MCPcopy Create free account
hub / github.com/Lobos/react-ui / open

Method open

src/Datepicker/Datetime.js:106–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

104 }
105
106 open () {
107 if (this.props.readOnly || this.state.active) {
108 return;
109 }
110
111 let today = new Date();
112 // remove time
113 today = new Date(today.getFullYear(), today.getMonth(), today.getDate());
114
115 let picker = this.refs.datepicker;
116 picker.style.display = 'block';
117 let height = getOuterHeight(picker);
118
119 setTimeout(() => {
120 this.setState({
121 active: true,
122 popup: overView(this.refs.datetime, height),
123 current: this.state.value || today,
124 stage: this.props.type === TIME ? 'clock' : 'day'
125 });
126
127 this.bindClickAway();
128
129 if (this.props.type === TIME) {
130 this.refs.clock.changeTimeStage('hour');
131 }
132 }, 0);
133 }
134
135 close () {
136 this.setState({ active: false });

Callers 4

createCORSRequestFunction · 0.80
FormBuilder.jsFile · 0.80
multOpenMethod · 0.80
renderMethod · 0.80

Calls 3

getOuterHeightFunction · 0.90
overViewFunction · 0.90
bindClickAwayMethod · 0.80

Tested by

no test coverage detected