From de1ab8fc814fb5b9132ed51261cd8ef0ef409e92 Mon Sep 17 00:00:00 2001 From: serapath Date: Wed, 6 Dec 2017 10:45:42 +0700 Subject: [PATCH] ADD settings option always-use-vm --- src/app/tabs/run-tab.js | 9 +++++++++ src/app/tabs/settings-tab.js | 10 ++++++++++ 2 files changed, 19 insertions(+) diff --git a/src/app/tabs/run-tab.js b/src/app/tabs/run-tab.js index b8f6de63d3e..45d6e08dc12 100644 --- a/src/app/tabs/run-tab.js +++ b/src/app/tabs/run-tab.js @@ -570,6 +570,15 @@ function settings (container, appAPI, appEvents) { ` + 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 diff --git a/src/app/tabs/settings-tab.js b/src/app/tabs/settings-tab.js index 867802870a6..d02eada12ce 100644 --- a/src/app/tabs/settings-tab.js +++ b/src/app/tabs/settings-tab.js @@ -43,6 +43,7 @@ function SettingsTab (container, appAPI, appEvents, opts) { var queryParams = new QueryParams() + var optionVM = yo`` var el = yo`
@@ -56,6 +57,10 @@ function SettingsTab (container, appAPI, appEvents, opts) {
Text Wrap
+
+
${optionVM}
+ Always use VM +
Enable Optimization @@ -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)