From d56f79d484ba4b7d1b536863408e4f7c9437bd85 Mon Sep 17 00:00:00 2001 From: d11e9 Date: Tue, 27 Oct 2015 13:53:13 +0000 Subject: [PATCH] only render contract interfaces if RHP is visible --- assets/js/universal-dapp.js | 2 +- index.html | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/assets/js/universal-dapp.js b/assets/js/universal-dapp.js index dcd05d38a2..8c3f1da277 100644 --- a/assets/js/universal-dapp.js +++ b/assets/js/universal-dapp.js @@ -5,7 +5,7 @@ function UniversalDApp (contracts, options) { this.renderOutputModifier = options.renderOutputModifier || function(name, content) { return content; }; if (!options.vm && web3.currentProvider) { - + console.log("Provider already set") } else if (options.vm) { this.vm = new EthVm(); //@todo this does not calculate the gas costs correctly but gets the job done. diff --git a/index.html b/index.html index 9c7faaa5ec..9307e1870b 100644 --- a/index.html +++ b/index.html @@ -238,7 +238,7 @@ var endpoint = $('#web3Endpoint').val(); web3.setProvider( new web3.providers.HttpProvider( endpoint ) ); compile(); - } ); + }); function executionContextChange (ev) { if (ev.target.value == 'web3' && !confirm("Are you sure you want to connect to a local ethereum node?") ) { @@ -467,7 +467,8 @@ $('.toggleRHP').click(function(){ toggledRHP = !toggledRHP; setEditorSize( toggledRHP ? 0 : window.localStorage[EDITOR_SIZE_CACHE_KEY] ); - $('.toggleRHP').toggleClass('toggled', toggledRHP) + $('.toggleRHP').toggleClass('toggled', toggledRHP); + if (!toggledRHP) compile(); }); @@ -499,7 +500,6 @@ var previousInput = ''; var sourceAnnotations = []; var compile = function() { - editor.getSession().clearAnnotations(); sourceAnnotations = []; editor.getSession().removeMarker(errMarkerId); @@ -530,7 +530,7 @@ }); } - if (noFatalErrors) renderContracts(data, editor.getValue()); + if (noFatalErrors && !toggledRHP) renderContracts(data, editor.getValue()); }; var compileTimeout = null;