fix debounce on safari
This commit is contained in:
parent
a4b6dd194e
commit
0ccfeb6b9c
2 changed files with 7 additions and 7 deletions
|
@ -27,7 +27,7 @@ import InlineSVG from 'react-inlinesvg';
|
|||
const downArrowUrl = require('../../../images/down-arrow.svg');
|
||||
import classNames from 'classnames';
|
||||
|
||||
import { debounce } from 'throttle-debounce';
|
||||
import { debounce } from 'lodash';
|
||||
|
||||
class Editor extends React.Component {
|
||||
constructor(props) {
|
||||
|
@ -49,7 +49,7 @@ class Editor extends React.Component {
|
|||
gutters: ['CodeMirror-lint-markers'],
|
||||
keyMap: 'sublime',
|
||||
lint: {
|
||||
onUpdateLinting: debounce(2000, (annotations) => {
|
||||
onUpdateLinting: debounce((annotations) => {
|
||||
this.props.clearLintMessage();
|
||||
annotations.forEach((x) => {
|
||||
if (x.from.line > -1) {
|
||||
|
@ -59,17 +59,17 @@ class Editor extends React.Component {
|
|||
if (this.props.lintMessages.length > 0 && this.props.lintWarning) {
|
||||
this.beep.play();
|
||||
}
|
||||
})
|
||||
}, 2000)
|
||||
}
|
||||
});
|
||||
|
||||
this._cm.on('change', debounce(400, () => {
|
||||
this._cm.on('change', debounce(() => {
|
||||
this.props.setUnsavedChanges(true);
|
||||
this.props.updateFileContent(this.props.file.name, this._cm.getValue());
|
||||
if (this.props.autorefresh && this.props.isPlaying) {
|
||||
this.props.startRefreshSketch();
|
||||
}
|
||||
}));
|
||||
}, 400));
|
||||
|
||||
this._cm.on('keyup', () => {
|
||||
const temp = `line ${parseInt((this._cm.getCursor().line) + 1, 10)}`;
|
||||
|
|
|
@ -74,7 +74,7 @@
|
|||
"dropzone": "^4.3.0",
|
||||
"escape-string-regexp": "^1.0.5",
|
||||
"eslint-loader": "^1.3.0",
|
||||
"express": "^4.13.4",
|
||||
"express": "^4.13.4",
|
||||
"express-session": "^1.13.0",
|
||||
"file-saver": "^1.3.2",
|
||||
"file-type": "^3.8.0",
|
||||
|
@ -83,6 +83,7 @@
|
|||
"jshint": "^2.9.2",
|
||||
"jszip": "^3.0.0",
|
||||
"jszip-utils": "0.0.2",
|
||||
"lodash": "^4.16.4",
|
||||
"loop-protect": "git+https://git@github.com/sagar-sm/loop-protect.git",
|
||||
"moment": "^2.14.1",
|
||||
"mongoose": "^4.4.16",
|
||||
|
@ -104,7 +105,6 @@
|
|||
"s3-policy": "^0.2.0",
|
||||
"shortid": "^2.2.6",
|
||||
"srcdoc-polyfill": "^0.2.0",
|
||||
"throttle-debounce": "^1.0.1",
|
||||
"xhr": "^2.2.1"
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue