mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Cleanup settings-web (#280)
This commit is contained in:
committed by
Bartosz Sosnowski
parent
5f5402aa0a
commit
ffa1b1e6a3
@@ -1,25 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<script>
|
||||
window.output_from_webview = function(arg) {
|
||||
if (typeof (window.external) !== 'undefined' && ('notify' in window.external)) {
|
||||
window.external.notify(arg);
|
||||
}
|
||||
}
|
||||
function receive_from_settings_app(arg) {
|
||||
window.react_app_component.receive_config_msg(JSON.parse(arg));
|
||||
return "";
|
||||
}
|
||||
function exit_settings_app() {
|
||||
window.react_app_component.receive_exit_request();
|
||||
return "";
|
||||
}
|
||||
</script>
|
||||
<title>PowerToys Settings</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<script src="dist/bundle.js" charset="UTF-8"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -9,11 +9,11 @@
|
||||
}
|
||||
function receive_from_settings_app(arg) {
|
||||
window.react_app_component.receive_config_msg(JSON.parse(arg));
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
function exit_settings_app() {
|
||||
window.react_app_component.receive_exit_request();
|
||||
return "";
|
||||
return '';
|
||||
}
|
||||
</script>
|
||||
<title>PowerToys Settings</title>
|
||||
|
||||
@@ -10,4 +10,3 @@ export class BaseSettingsControl extends React.Component <any, any> {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@ export class BoolToggleSettingsControl extends BaseSettingsControl {
|
||||
this.setState({ property_values: props.setting })
|
||||
}
|
||||
|
||||
|
||||
public get_value() : any {
|
||||
return {value: this.toggleref.checked};
|
||||
}
|
||||
@@ -45,5 +44,4 @@ export class BoolToggleSettingsControl extends BaseSettingsControl {
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -41,5 +41,4 @@ export class ColorPickerSettingsControl extends BaseSettingsControl {
|
||||
</Stack>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,12 +19,13 @@ export class CustomSettingsScreen extends React.Component <any, any> {
|
||||
powertoy: props.powertoy,
|
||||
}
|
||||
}
|
||||
shouldComponentUpdate(nextProps:any, nextState:any)
|
||||
{
|
||||
|
||||
shouldComponentUpdate(nextProps:any, nextState:any) {
|
||||
// This component and its children manage their state.
|
||||
// React only to state changes when forceUpdate is called by the App component.
|
||||
return false;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(props: any) {
|
||||
this.setState({ powertoy: props.powertoy })
|
||||
}
|
||||
|
||||
@@ -17,12 +17,13 @@ export class GeneralSettings extends React.Component <any, any> {
|
||||
settings: props.settings,
|
||||
}
|
||||
}
|
||||
shouldComponentUpdate(nextProps:any, nextState:any)
|
||||
{
|
||||
|
||||
shouldComponentUpdate(nextProps:any, nextState:any) {
|
||||
// This component and its children manage their state.
|
||||
// React only to state changes when forceUpdate is called by the App component.
|
||||
return false;
|
||||
}
|
||||
|
||||
componentWillReceiveProps(props: any) {
|
||||
this.setState({ settings: props.settings })
|
||||
}
|
||||
|
||||
@@ -95,5 +95,4 @@ export class IntSpinnerSettingsControl extends BaseSettingsControl {
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,4 +26,3 @@ if (root && root.hasChildNodes()) {
|
||||
/>,
|
||||
root);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user