ADD settings option always-use-vm

pull/3094/head
serapath 7 years ago
parent 46fd2afa88
commit 182a12a90b
  1. 9
      src/app/tabs/run-tab.js
  2. 10
      src/app/tabs/settings-tab.js

@ -570,6 +570,15 @@ function settings (container, appAPI, appEvents) {
</div>
`
setTimeout(function () {
var select = document.querySelector('#selectExEnvOptions')
var optionVMindex = 0
if (appAPI.config.get('settings/always-use-vm')) {
// select.options[optionVMindex].selected = true
select.selectedIndex = optionVMindex
}
}, 0)
// EVENTS
appEvents.udapp.register('transactionExecuted', (error, from, to, data, lookupOnly, txResult) => {
if (error) return

@ -43,6 +43,7 @@ function SettingsTab (container, appAPI, appEvents, opts) {
var queryParams = new QueryParams()
var optionVM = yo`<input class="${css.col1}" id="alwaysUseVM" type="checkbox">`
var el = yo`
<div class="${css.settingsTabView} "id="settingsView">
<div class="${css.info}">
@ -56,6 +57,10 @@ function SettingsTab (container, appAPI, appEvents, opts) {
<div><input class="${css.col1}" id="editorWrap" type="checkbox"></div>
<span class="${css.checkboxText}">Text Wrap</span>
</div>
<div class="${css.crow}">
<div>${optionVM}</div>
<span class="${css.checkboxText}">Always use VM</span>
</div>
<div class="${css.crow}">
<div><input class="${css.col1}" id="optimize" type="checkbox"></div>
<span class="${css.checkboxText}">Enable Optimization</span>
@ -67,6 +72,11 @@ function SettingsTab (container, appAPI, appEvents, opts) {
setVersionText(version, el)
})
optionVM.checked = appAPI.config.get('settings/always-use-vm') || false
optionVM.addEventListener('change', event => {
appAPI.config.set('settings/always-use-vm', !appAPI.config.get('settings/always-use-vm'))
})
var optimize = el.querySelector('#optimize')
if ((queryParams.get().optimize === 'true')) {
optimize.setAttribute('checked', true)

Loading…
Cancel
Save