vendor/assets/javascripts/raphael.morris.js in character-1.0.2 vs vendor/assets/javascripts/raphael.morris.js in character-1.0.3

- old
+ new

@@ -125,12 +125,11 @@ }); this.el.bind('touchstart touchmove touchend', function(evt) { var offset, touch; touch = evt.originalEvent.touches[0] || evt.originalEvent.changedTouches[0]; offset = _this.el.offset(); - _this.fire('hover', touch.pageX - offset.left, touch.pageY - offset.top); - return touch; + return _this.fire('hovermove', touch.pageX - offset.left, touch.pageY - offset.top); }); this.el.bind('click', function(evt) { var offset; offset = _this.el.offset(); return _this.fire('gridclick', evt.pageX - offset.left, evt.pageY - offset.top); @@ -158,10 +157,11 @@ window.clearTimeout(_this.timeoutId); } return _this.timeoutId = window.setTimeout(_this.resizeHandler, 100); }); } + this.el.css('-webkit-tap-highlight-color', 'rgba(0,0,0,0)'); if (this.postInit) { this.postInit(); } } @@ -661,13 +661,17 @@ this.el.hide(); this.options.parent.append(this.el); } Hover.prototype.update = function(html, x, y) { - this.html(html); - this.show(); - return this.moveTo(x, y); + if (!html) { + return this.hide(); + } else { + this.html(html); + this.show(); + return this.moveTo(x, y); + } }; Hover.prototype.html = function(content) { return this.el.html(content); }; @@ -1480,11 +1484,11 @@ }; Bar.prototype.drawSeries = function() { var barWidth, bottom, groupWidth, idx, lastTop, left, leftPadding, numBars, row, sidx, size, spaceLeft, top, ypos, zeroPos; groupWidth = this.width / this.options.data.length; - numBars = this.options.stacked != null ? 1 : this.options.ykeys.length; + numBars = this.options.stacked ? 1 : this.options.ykeys.length; barWidth = (groupWidth * this.options.barSizeRatio - this.options.barGap * (numBars - 1)) / numBars; if (this.options.barSize) { barWidth = Math.min(barWidth, this.options.barSize); } spaceLeft = groupWidth - barWidth * numBars - this.options.barGap * (numBars - 1); @@ -1514,9 +1518,12 @@ left = this.left + idx * groupWidth + leftPadding; if (!this.options.stacked) { left += sidx * (barWidth + this.options.barGap); } size = bottom - top; + if (this.options.verticalGridCondition && this.options.verticalGridCondition(row.x)) { + this.drawBar(this.left + idx * groupWidth, this.top, groupWidth, Math.abs(this.top - this.bottom), this.options.verticalGridColor, this.options.verticalGridOpacity, this.options.barRadius); + } if (this.options.stacked) { top -= lastTop; } this.drawBar(left, top, barWidth, size, this.colorFor(row, sidx, 'bar'), this.options.barOpacity, this.options.barRadius); _results1.push(lastTop += size);