Comparing version 0.0.20 to 0.0.21
@@ -17,2 +17,3 @@ /** | ||
initialize: function() { | ||
// Initialize all subviews | ||
@@ -49,3 +50,15 @@ this.subview( 'viewport', new Viewport({ | ||
template: kt.make(__dirname+'/ChartView.html','_'), | ||
// Override of setElement because we want | ||
// a single inner table inside this.$el. | ||
// This is to solve a horizontal scrollbar | ||
// issue when data is being re-rendered. | ||
setElement: function(element, delegate) { | ||
// Call parent setElement | ||
bassview.prototype.setElement.call(this, element, delegate); | ||
// Create inner table | ||
this.$inner = $('<table class="chart-inner"></table>'); | ||
this.$el.html(this.$inner); | ||
return this; | ||
}, | ||
@@ -58,3 +71,3 @@ render: function() { | ||
this.lockHeight(); | ||
this.lockDimensions(); | ||
@@ -69,3 +82,3 @@ // For other elements to do things before render process | ||
// Replace html | ||
this.$el.html(markup); | ||
this.$inner.html(markup); | ||
@@ -83,3 +96,3 @@ // Assign subviews | ||
this.unlockHeight(); | ||
this.unlockDimensions(); | ||
@@ -90,3 +103,3 @@ return this; | ||
toggleMultiY: function() { | ||
this.lockHeight(); | ||
this.lockDimensions(); | ||
var yaxes = this.subview('yaxes'); | ||
@@ -96,10 +109,15 @@ if (yaxes) yaxes.toggleMultiY(); | ||
lockHeight: function() { | ||
lockDimensions: function() { | ||
// Lock height to prevent scrollbar craziness | ||
var new_height = this.$('.chart-xaxis').height() + this.model.get('vp_height'); | ||
this.$el.css({'height':new_height}); | ||
var new_width = this.$('.chart-yaxes').width() + this.model.get('vp_width'); | ||
this.$el.css({ | ||
'height':new_height+'px' | ||
}); | ||
this.$inner.css({'width':new_width+'px'}); | ||
}, | ||
unlockHeight: function() { | ||
this.$el.css({'height':'auto'}); | ||
unlockDimensions: function() { | ||
this.$el.css({'height':'auto','width':'auto'}); | ||
this.$inner.css({'width':'auto'}); | ||
}, | ||
@@ -109,5 +127,7 @@ | ||
this.subview('viewport').subview('resizer').autoSize(); | ||
} | ||
}, | ||
template: kt.make(__dirname+'/ChartView.html','_'), | ||
}); | ||
exports = module.exports = ChartView; |
{ | ||
"name": "charted", | ||
"version": "0.0.20", | ||
"version": "0.0.21", | ||
"description": "Charts an entire collection of data. Single or multiple y-axes. Support for 64-bit integers. Auto-resizing axes.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
Sorry, the diff of this file is not supported yet
625391
18221