remove react on touch tap

This commit is contained in:
Casper Lamboo 2018-06-26 16:08:33 +02:00
parent 246f1627c5
commit ebbc985d67
6 changed files with 25 additions and 38 deletions

View File

@ -1,9 +1,8 @@
import 'babel-polyfill'
import 'babel-polyfill';
import React from 'react';
import { Interface } from 'doodle3d-slicer';
import { render } from 'react-dom';
import MuiThemeProvider from 'material-ui/styles/MuiThemeProvider';
import injectTapEventPlugin from 'react-tap-event-plugin';
import jss from 'jss';
import preset from 'jss-preset-default';
import normalize from 'normalize-jss';
@ -19,8 +18,6 @@ const muiTheme = getMuiTheme({
}
});
injectTapEventPlugin();
jss.setup(preset());
jss.createStyleSheet(normalize).attach();
jss.createStyleSheet({

19
package-lock.json generated
View File

@ -33,7 +33,7 @@
}
},
"@doodle3d/doodle3d-core": {
"version": "github:doodle3d/doodle3d-core#ac2256d2c541fb465f959131f6a216574be7f70b",
"version": "github:doodle3d/doodle3d-core#02e312247cc64a5cc1abc03a8e0538602d9bdc98",
"requires": {
"@doodle3d/cal": "0.0.8",
"@doodle3d/clipper-js": "1.0.10",
@ -50,7 +50,7 @@
"font-loaded": "1.0.0",
"google-fonts-webpack-plugin": "0.4.4",
"imports-loader": "0.7.1",
"jss": "9.8.1",
"jss": "9.8.7",
"keycode": "2.1.9",
"lodash": "4.17.4",
"memoizee": "0.3.10",
@ -77,9 +77,9 @@
},
"dependencies": {
"jss": {
"version": "9.8.1",
"resolved": "https://registry.npmjs.org/jss/-/jss-9.8.1.tgz",
"integrity": "sha512-a9dXInEPTRmdSmzw3LNhbAwdQVZgCRmFU7dFzrpLTMAcdolHXNamhxQ6J+PNIqUtWa9yRbZIzWX6aUlI55LZ/A==",
"version": "9.8.7",
"resolved": "https://registry.npmjs.org/jss/-/jss-9.8.7.tgz",
"integrity": "sha512-awj3XRZYxbrmmrx9LUSj5pXSUfm12m8xzi/VKeqI1ZwWBtQ0kVPTs3vYs32t4rFw83CgFDukA8wKzOE9sMQnoQ==",
"requires": {
"is-in-browser": "1.1.3",
"symbol-observable": "1.2.0",
@ -9786,15 +9786,6 @@
"prop-types": "15.6.0"
}
},
"react-tap-event-plugin": {
"version": "3.0.2",
"resolved": "https://registry.npmjs.org/react-tap-event-plugin/-/react-tap-event-plugin-3.0.2.tgz",
"integrity": "sha1-KANxZ3uIHDE3bgAnoLhtLG3gOe4=",
"dev": true,
"requires": {
"fbjs": "0.8.16"
}
},
"react-transition-group": {
"version": "1.2.1",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-1.2.1.tgz",

View File

@ -65,7 +65,6 @@
"material-ui": "^0.19.4",
"normalize-jss": "^4.0.0",
"raw-loader": "^0.5.1",
"react-tap-event-plugin": "^3.0.2",
"webpack": "^3.3.0",
"webpack-dev-server": "^2.5.1",
"worker-loader": "^0.8.1",

View File

@ -38,7 +38,7 @@ const _TextField = ({ name, muiTheme: { palette }, ...props }, context) => (
{...props}
icon={context.advancedFields.includes(name) && <RefreshIcon
style={{ fill: palette.textColor }}
onTouchTap={() => context.onChange(name, null)}
onClick={() => context.onChange(name, null)}
/>}
floatingLabelStyle={{
color: context.advancedFields.includes(name) ? palette.primary1Color : palette.primary3Color
@ -58,7 +58,7 @@ const _NumberField = ({ name, min, max, muiTheme: { palette }, ...props }, conte
type="number"
icon={context.advancedFields.includes(name) && <RefreshIcon
style={{ fill: palette.textColor }}
onTouchTap={() => context.onChange(name, null)}
onClick={() => context.onChange(name, null)}
/>}
floatingLabelStyle={{
color: context.advancedFields.includes(name) ? palette.primary1Color : palette.primary3Color
@ -95,7 +95,7 @@ const _Checkbox = ({ name, muiTheme: { palette }, ...props }, context) => (
onCheck={(event, value) => context.onChange(name, value)}
/>
{context.advancedFields.includes(name) && <RefreshIcon
onTouchTap={() => context.onChange(name, null)}
onClick={() => context.onChange(name, null)}
/>}
</span>
);

View File

@ -415,10 +415,10 @@ class Settings extends React.Component {
<MenuItem key={id} value={id} primaryText={name} />
))}
<Divider />
<MenuItem onTouchTap={this.openAddPrinterDialog} value="add_printer" primaryText="Add Printer" />
<MenuItem onClick={this.openAddPrinterDialog} value="add_printer" primaryText="Add Printer" />
</SelectField>
{localStorage.active && <SettingsIcon
onTouchTap={this.openManagePrinterDialog}
onClick={this.openManagePrinterDialog}
style={{ fill: grey800, marginLeft: '10px', cursor: 'pointer' }}
/>}
</div>
@ -525,16 +525,16 @@ function printDialog(props, state, title, form, submitText, data, closeDialog, r
actions={[
closeDialog && <FlatButton
label="Close"
onTouchTap={closeDialog}
onClick={closeDialog}
/>,
removeActivePrinter && <FlatButton
label="Remove Printer"
onTouchTap={removeActivePrinter}
onClick={removeActivePrinter}
/>,
<RaisedButton
label={submitText}
primary
onTouchTap={save}
onClick={save}
/>
]}
>
@ -551,7 +551,7 @@ function printDialog(props, state, title, form, submitText, data, closeDialog, r
{wifiBoxes.map(({ localip, id, wifiboxid }) => (<MenuItem key={id} value={localip} primaryText={wifiboxid} />))}
</SelectField>
{data.ip && <ExitToAppIcon
onTouchTap={() => window.open(`${CONNECT_URL}/?uuid=0#control?localip=${data.ip}`, '_blank')}
onClick={() => window.open(`${CONNECT_URL}/?uuid=0#control?localip=${data.ip}`, '_blank')}
style={{ fill: grey800, marginLeft: '10px', cursor: 'pointer' }}
/>}
</div>

View File

@ -357,13 +357,13 @@ class Interface extends React.Component {
{onCancel && <RaisedButton
label="Close"
className={`${classes.button}`}
onTouchTap={onCancel}
onClick={onCancel}
/>}
{actions.length === 1 ? (
<RaisedButton
primary
label={actions[0].title}
onTouchTap={() => this.slice(actions[0])}
onClick={() => this.slice(actions[0])}
className={`${classes.button}`}
disabled={isSlicing}
/>
@ -374,7 +374,7 @@ class Interface extends React.Component {
ref="button"
primary
className={`${classes.button}`}
onTouchTap={this.openPopover}
onClick={this.openPopover}
disabled={isSlicing}
/>
<Popover
@ -386,7 +386,7 @@ class Interface extends React.Component {
>
<Menu>
{actions.map((action) => (
<MenuItem key={action.target} primaryText={action.title} onTouchTap={() => this.slice(action)} />
<MenuItem key={action.target} primaryText={action.title} onClick={() => this.slice(action)} />
))}
</Menu>
</Popover>
@ -405,12 +405,12 @@ class Interface extends React.Component {
<div className={classes.detail}>
<p>Dimensions: {objectDimensions}</p>
</div>
<RaisedButton disabled={isSlicing} className={classes.controlButton} onTouchTap={this.resetMesh} label="reset" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onTouchTap={this.scaleUp} label="scale down" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onTouchTap={this.scaleDown} label="scale up" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onTouchTap={this.rotateX} label="rotate x" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onTouchTap={this.rotateY} label="rotate y" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onTouchTap={this.rotateZ} label="rotate z" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onClick={this.resetMesh} label="reset" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onClick={this.scaleUp} label="scale down" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onClick={this.scaleDown} label="scale up" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onClick={this.rotateX} label="rotate x" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onClick={this.rotateY} label="rotate y" />
<RaisedButton disabled={isSlicing} className={classes.controlButton} onClick={this.rotateZ} label="rotate z" />
</div>
</div>
);