Skip to content

Commit

Permalink
Set both width and height at the same time for RangeSlider.Preview pr…
Browse files Browse the repository at this point in the history
…eviews
  • Loading branch information
Katie McLaughlin committed Mar 27, 2014
1 parent 05b22b6 commit 1155048
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/js/Rickshaw.Graph.RangeSlider.Preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,19 +57,12 @@ Rickshaw.Graph.RangeSlider.Preview = Rickshaw.Class.create({
: this.defaults[k];
}, this);

if (args.width) {
this.previews.forEach(function(preview) {
var width = args.width - this.config.frameHandleThickness * 2;
preview.setSize({ width: width });
}, this);
}
this.previews.forEach(function(preview) {
var height = this.previewHeight / this.graphs.length;
var width = args.width - this.config.frameHandleThickness * 2;
preview.setSize({ width: width, height: height });
}, this);

if (args.height) {
this.previews.forEach(function(preview) {
var height = this.previewHeight / this.graphs.length;
preview.setSize({ height: height });
}, this);
}
},

render: function() {
Expand Down

0 comments on commit 1155048

Please sign in to comment.