Last active
December 20, 2017 02:28
-
-
Save devonwesley/d3a8d80f976035c497a7005a359bbafd to your computer and use it in GitHub Desktop.
These our the 3 panel containers for our contract props.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createPropsContainers(panel, callback) { | |
document.getElementById('contractFunction').appendChild(panel) | |
const propsList = createPanelContainer('props') | |
const hashList = createPanelContainer('hashes') | |
const functionList = createPanelContainer() | |
const banner = '<H3><strong>Contract Functions: </strong></H3>' | |
functionList.innerHTML = banner | |
panel.append(propsList) | |
panel.append(hashList) | |
panel.append(functionList) | |
callback({ propsList, hashList, functionList }) | |
} | |
function createPanelContainer(label) { | |
const notProp = label !== 'props' || label !== 'hashes' | |
const el = notProp ? 'UL' : 'DIV' | |
const key = notProp ? 'listStyleType' : 'marginLeft' | |
const list = document.createElement(el) | |
list.className = notProp ? 'mui-row' : 'mui-panel' | |
list.style[key] = notProp ? 'none' : 0 | |
return list | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment