Skip to content

Instantly share code, notes, and snippets.

@devonwesley
Last active December 20, 2017 02:28
Show Gist options
  • Save devonwesley/d3a8d80f976035c497a7005a359bbafd to your computer and use it in GitHub Desktop.
Save devonwesley/d3a8d80f976035c497a7005a359bbafd to your computer and use it in GitHub Desktop.
These our the 3 panel containers for our contract props.
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