MCPcopy Create free account
hub / github.com/BloombergGraphics/whatiscode / showFootnote

Function showFootnote

scripts/main.js:155–180  ·  view source on GitHub ↗
(d,i)

Source from the content-addressed store, hash-verified

153 .on('touchend', toggleFootnote)
154
155 function showFootnote(d,i) {
156 var popup = d3.select(this.parentElement).select(".fn-popup");
157 if(!popup.classed("stick") || isMobile) {
158 popup
159 .style("opacity", 0)
160 .style("display", "block")
161 .transition().duration(300)
162 .style("opacity", 1);
163 }
164
165 d3.select(this.parentElement)
166 .style('position', isMobile ? 'static' : 'relative')
167
168 var bb = this.getBoundingClientRect()
169 if (isMobile){
170 popup
171 .style('top', bb.top + scrollY + 20 + 'px')
172 .style('left', 160 + 'px')
173 } else{
174 popup
175 .style('top', '')
176 .style('left', '')
177 }
178
179
180 }
181
182 function hideFootnote(d,i) {
183 var popup = d3.select(this.parentElement).select(".fn-popup");

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected