bigbluebutton-Github/bigbluebutton-html5/imports/ui/components/settings/submenus/base/component.jsx

28 lines
633 B
React
Raw Normal View History

2016-05-06 05:14:39 +08:00
import React from 'react';
export default class BaseMenu extends React.Component {
constructor(props) {
super(props);
2017-02-16 02:49:40 +08:00
this.handleUpdateSettings = props.handleUpdateSettings;
2016-05-06 05:14:39 +08:00
}
2017-02-16 02:49:40 +08:00
handleToggle(key) {
2017-06-03 03:25:02 +08:00
const obj = this.state;
obj.settings[key] = !this.state.settings[key];
2017-02-16 02:49:40 +08:00
this.setState(obj, () => {
this.handleUpdateSettings(this.state.settingsName, this.state.settings);
2017-02-16 02:49:40 +08:00
});
2016-05-06 05:14:39 +08:00
}
handleInput(key, e) {
const obj = this.state;
obj.settings[key] = e.target.value;
this.setState(obj, () => {
this.handleUpdateSettings(this.state.settingsName, this.state.settings);
});
}
2017-06-03 03:25:02 +08:00
}