1
0
mirror of https://github.com/chinchang/web-maker.git synced 2025-05-07 19:15:24 +02:00

setting: preview wait time change setting

This commit is contained in:
Kushagra Gour 2019-03-04 18:13:32 +05:30
parent 56167101ce
commit db1fafbfa1
4 changed files with 39 additions and 19 deletions

View File

@ -25,7 +25,6 @@ export default class ContentWrap extends Component {
}; };
this.updateTimer = null; this.updateTimer = null;
this.updateDelay = 500;
this.htmlMode = HtmlModes.HTML; this.htmlMode = HtmlModes.HTML;
this.jsMode = HtmlModes.HTML; this.jsMode = HtmlModes.HTML;
this.cssMode = CssModes.CSS; this.cssMode = CssModes.CSS;
@ -124,7 +123,7 @@ export default class ContentWrap extends Component {
trackEvent('fn', 'usingPreview'); trackEvent('fn', 'usingPreview');
} }
} }
}, this.updateDelay); }, this.props.prefs.previewDelay);
} }
createPreviewFile(html, css, js) { createPreviewFile(html, css, js) {

View File

@ -41,7 +41,6 @@ export default class ContentWrapFiles extends Component {
this.fileBuffers = {}; this.fileBuffers = {};
this.updateTimer = null; this.updateTimer = null;
this.updateDelay = 500;
this.htmlMode = HtmlModes.HTML; this.htmlMode = HtmlModes.HTML;
this.prefs = {}; this.prefs = {};
this.cmCodes = { html: props.currentItem.html, css: '', js: '' }; this.cmCodes = { html: props.currentItem.html, css: '', js: '' };
@ -229,7 +228,7 @@ export default class ContentWrapFiles extends Component {
trackEvent('fn', 'usingPreview'); trackEvent('fn', 'usingPreview');
} }
} }
}, this.updateDelay); }, this.props.prefs.previewDelay);
} }
createPreviewFile() { createPreviewFile() {

View File

@ -340,6 +340,25 @@ export default class Settings extends Component {
</HelpText> </HelpText>
</TabPanel> </TabPanel>
<TabPanel label="Advanced"> <TabPanel label="Advanced">
<div>
<label class="line">
Preview refresh wait time
<div>
<input
type="number"
style="width:120px"
value={prefs.previewDelay}
onChange={e => this.updateSetting(e, 'previewDelay')}
/>{' '}
ms
</div>
</label>
<HelpText>
Once you stop typing, the preview waits for this much time
before getting updated. Too low value might choke your browser!
</HelpText>
</div>
<Divider />
<div> <div>
<label class="line"> <label class="line">
Maximum time allowed in a loop iteration Maximum time allowed in a loop iteration
@ -359,22 +378,24 @@ export default class Settings extends Component {
stopped. stopped.
</HelpText> </HelpText>
</div> </div>
<Divider /> {/*
<Divider />
<div>
<div>
<label class="line"> <label class="line">
Language Language
<select <select
value={prefs.lang} value={prefs.lang}
onChange={e => this.updateSetting(e, 'lang')} onChange={e => this.updateSetting(e, 'lang')}
> >
<option value="en">English</option> <option value="en">English</option>
<option value="hi">Hindi</option> <option value="hi">Hindi</option>
<option value="sa">Sanskrit</option> <option value="sa">Sanskrit</option>
<option value="es">Spanish</option> <option value="es">Spanish</option>
</select> </select>
</label> </label>
</div> </div>
*/}
</TabPanel> </TabPanel>
</Tabs> </Tabs>
</div> </div>

View File

@ -135,7 +135,8 @@ export default class App extends Component {
isJs13kModeOn: false, isJs13kModeOn: false,
autoCloseTags: true, autoCloseTags: true,
lang: 'en', lang: 'en',
isMonacoEditorOn: false isMonacoEditorOn: false,
previewDelay: 500
}; };
this.prefs = {}; this.prefs = {};