app/assets/javascripts/plasticine/column.coffee in plasticine-1.2.4 vs app/assets/javascripts/plasticine/column.coffee in plasticine-1.2.5
- old
+ new
@@ -1,9 +1,7 @@
class @PlasticineColumn
constructor: (@holder) ->
- @holder = $('.plasticine-column')
-
PlasticineHelpers.setLocale()
@drawTooltip()
@xScale = d3.scaleBand()
@setXScaleRange()
@@ -68,11 +66,11 @@
holderWidth: () -> @holder.width()
refreshColumns: () ->
self = this
- $('g.column').remove()
+ @holder.find('g.column').remove()
@columns.enter().append("g").attr('class', 'column')
.attr('data-x-val', (d) -> d.x_value)
.attr('x', (d) => @xScale(d.x))
.attr('transform', (d) => 'translate(' + @xScale(d.x) + ',0)')
@@ -145,9 +143,9 @@
tooltip.html(data.tooltip)
tooltip.fadeIn 200
tooltipX = xPosition - (tooltip.outerWidth() / 2) + (parseInt(barNode.attr("width")) / 2)
- d3.select(".tooltip")
- .style("left", tooltipX + "px")
- .style("top", (yPosition - tooltip.outerHeight()) + "px")
+ tooltip
+ .css("left", tooltipX + "px")
+ .css("top", (yPosition - tooltip.outerHeight()) + "px")