Skip to content
This repository has been archived by the owner on Jun 13, 2023. It is now read-only.

Caches the contract code and ABI inputs #221

Merged
merged 10 commits into from
Jun 27, 2016

Conversation

alexvandesande
Copy link

Suggested on this PR: Add caching to contract #139

This is particularly useful when you need the address of a contract as one of the parameters for another contract (creating a dao that uses a token for example) and you want to go to another tab to copy it

@alexvandesande alexvandesande added this to the 0.8 milestone Jun 14, 2016
@@ -53,11 +53,11 @@
<select class="compiled-contracts">
<option disabled selected>{{i18n "wallet.contracts.pickContract"}}</option>
{{#each this}}
<option value="{{name}}">{{toSentence name true}}</option>
<option value="{{name}}" selected="{{selected}}">{{toSentence name true}}</option>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@alexvandesande The sole existence of selected attribute will mark the element as selected. So instead of outputting only true/false inside the selected attribute, the return value of your helper must be the attr itself.

Here I advise you to:
<option value="{{name}}" {{selected}}>{{...}}</option>

and then on helper:
contract.selected = (contract.name == e.currentTarget.value)? 'selected' : '';

Otherwise all elements will have the selected attribute, therefore, selecting the last element by default – the last element parsed. See this codepen for practical examples: http://codepen.io/evertonfraga/pen/YWGBON

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out blaze behaves differently from regular dom api on this matter. That won't be a problem. See blaze selected attribute issue

@alexvandesande alexvandesande merged commit 3428e64 into develop Jun 27, 2016
@alexvandesande alexvandesande deleted the save-contract-code-in-draft branch June 27, 2016 21:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants